Diese Begründung fehlt immer noch!Die Attachments (der Bytestream im Quellsystem ist in einer Tabelle mit Zeilen á 1024 Bytes) sollen im Zielsystem (Tabelle mit Zeilen á 1022 Bytes) abgelegt werden.
Ich dachte eigentlich die Begründung steht da: Im Zielsystem gibt es zur Ablage nur eine Tabelle mit Zeilenlänge 1022 Bytes. Wenn es auch anders gehen würde, hätte ich mir den Aufwand erspart.Warum SOLLEN die 1024 den in 1022 Byte umgewandelt werden?
Diese Begründung fehlt immer noch!
Code: Alles auswählen.
REPORT zsstest2 .
CONSTANTS: c_s TYPE i VALUE 10,
c_l TYPE i VALUE 26,
c_double TYPE i VALUE 46. " 2*max(c_s,c_l)
TYPES: ty_s(c_s) TYPE c, " kleines Charakterfeld
ty_l(c_l) TYPE c, " großes Charakterfeld
ty_double(c_double) TYPE c,
tyt_s TYPE STANDARD TABLE OF ty_s
WITH NON-UNIQUE DEFAULT KEY,
tyt_l TYPE STANDARD TABLE OF ty_l
WITH NON-UNIQUE DEFAULT KEY.
DATA: t_s TYPE tyt_s, " kleine Tabelle
t_l TYPE tyt_l, " große Tabelle
wa_s TYPE ty_s,
wa_l TYPE ty_l,
double TYPE ty_double,
offset TYPE i.
FIELD-SYMBOLS: <fs>.
END-OF-SELECTION.
**************** Füllen große Tabelle **************************
DO 10 TIMES.
APPEND sy-abcde TO t_l.
ENDDO.
**************** Umwandlung ******************************
LOOP AT t_l INTO wa_l.
double+offset = wa_l.
ADD c_l TO offset.
WHILE offset >= c_s.
SUBTRACT c_s FROM offset.
wa_s = double(c_s).
double = double+c_s.
APPEND wa_s TO t_s.
ENDWHILE.
AT LAST.
WHILE NOT double IS INITIAL.
wa_s = double(c_s).
double = double+c_s.
APPEND wa_s TO t_s.
ENDWHILE.
ENDAT.
ENDLOOP.
**************** Visualisierung ******************************
LOOP AT t_l ASSIGNING <fs>.
WRITE:/ <fs>.
ENDLOOP.
ULINE.
LOOP AT t_s ASSIGNING <fs>.
WRITE:/ <fs>.
ENDLOOP.Code: Alles auswählen.
DATA: lv_offs_k TYPE i,
lv_offs_g TYPE i,
lv_used_len_k TYPE i,
lv_leng TYPE i,
lv_last_row type xfeld.
CLEAR: lv_offs_k, lv_last_row.
LOOP AT lt_data_tab INTO ls_data_tab.
CLEAR lv_leng.
lv_leng = XSTRLEN( ls_data_tab-line ).
IF lv_leng = 0.
if lv_offs_k > 0.
append ls_content to lt_content.
endif.
EXIT.
elseif lv_leng LT 1024.
lv_last_row = 'X'.
ENDIF.
WHILE lv_offs_g < lv_leng.
ls_content-line+lv_offs_k = ls_data_tab-line+lv_offs_g.
lv_used_len_k = XSTRLEN( ls_content-line ).
lv_offs_g = lv_offs_g + lv_used_len_k - lv_offs_k.
IF lv_used_len_k = 1022 or ( lv_offs_g eq lv_leng and lv_last_row eq 'X' ).
CLEAR lv_offs_k.
APPEND ls_content TO lt_content.
ELSE.
lv_offs_k = lv_used_len_k.
ENDIF.
ENDWHILE.
ENDLOOP.
wenn es nicht stimmtIch habe eine Lösung, die ich hier auch noch posten werden, bin aber erstmal auf die Lösungen hier im Forum gespannt.
Ciao, LoLo
Habt ihr nur eine Tabelle im Zielsystem
Konvertiere die Bestellung ins Hexadezimale oder Binäre-Zahlensystem.
undKürze die erste Tabelle jeweils um Carriage Return und Line Feed oder mach einfach aus einer Zeile, zwei Zeilen..... oder drei oder vier...egal.
Oder nimm eine andere Tabelle
Ich möchte LoLo hier mal ganz explizit zustimmen, wenn sie dir die Abwesenheit deiner Kommentare dankt. ( Auch wenn ich ihr/ihm nicht zustimme, wenn sie Kommentare nicht begrüßt die sie/ihn nicht weiterbringen - es kommt darauf an zu versuchen hilfreich zu sein )Dann lass Dir meine Posting vorlesen... wenn du es selber nicht kannst.
Er gross rumprallen, du hättest eine Lösung ...und nun doch nicht.