w_field2(50) TYPE c,
cnt TYPE i,
lunghezza TYPE i,
cnt_field TYPE i, " field corrente nel buffer start
it_curr TYPE i,
fieldname TYPE dd03l-fieldname,
cnt_chare TYPE i,
lunghezza TYPE i,
cnt_field TYPE i, " field corrente nel buffer start
it_curr TYPE i,
fieldname TYPE dd03l-fieldname,
cnt_chare TYPE i,
FIELD-SYMBOLS: TYPE ANY.
FIELD-SYMBOLS: TYPE ANY.
FIELD-SYMBOLS:
MOVE 'BAPIMEPOITEM' TO wa_tabname.
SELECT COUNT( * ) FROM dd03l INTO lunghezza WHERE tabname = wa_tabname .
LOOP AT po_items.
MOVE-CORRESPONDING po_items TO poitem.
APPEND poitem.
cnt_field = 0 .
cnt_chare = 0 .
it_curr = 1.
ASSIGN (w_field1) TO.
ASSIGN (w_field2) TO.
WHILE cnt_chare <= lunghezza .
SELECT SINGLE * FROM dd03l WHERE tabname = wa_tabname
AND position = it_curr.
fieldname = dd03l-fieldname.
cnt_chare = cnt_chare + 1.
it_curr = it_curr + 1 .
CLEAR w_field2.
CONCATENATE 'POITEM-' fieldname INTO w_field2 IN CHARACTER MODE.
CONDENSE w_field2 NO-GAPS.
ASSIGN (w_field2) TO.
IF sy-subrc = 0 AND IS NOT INITIAL.
CLEAR w_field1.
CONCATENATE 'POITEMX-' fieldname INTO w_field1 IN CHARACTER MODE.
CONDENSE w_field1 NO-GAPS.
IF cnt_chare = 1.
ASSIGN (w_field1) TO.
= po_items-po_item.
CONTINUE.
ENDIF.
ASSIGN (w_field1) TO.
= 'X'.
ENDIF.
ENDWHILE.
APPEND poitemx.
CLEAR poitemx.
ENDLOOP.
SELECT COUNT( * ) FROM dd03l INTO lunghezza WHERE tabname = wa_tabname .
LOOP AT po_items.
MOVE-CORRESPONDING po_items TO poitem.
APPEND poitem.
cnt_field = 0 .
cnt_chare = 0 .
it_curr = 1.
ASSIGN (w_field1) TO
ASSIGN (w_field2) TO
WHILE cnt_chare <= lunghezza .
SELECT SINGLE * FROM dd03l WHERE tabname = wa_tabname
AND position = it_curr.
fieldname = dd03l-fieldname.
cnt_chare = cnt_chare + 1.
it_curr = it_curr + 1 .
CLEAR w_field2.
CONCATENATE 'POITEM-' fieldname INTO w_field2 IN CHARACTER MODE.
CONDENSE w_field2 NO-GAPS.
ASSIGN (w_field2) TO
IF sy-subrc = 0 AND
CLEAR w_field1.
CONCATENATE 'POITEMX-' fieldname INTO w_field1 IN CHARACTER MODE.
CONDENSE w_field1 NO-GAPS.
IF cnt_chare = 1.
ASSIGN (w_field1) TO
CONTINUE.
ENDIF.
ASSIGN (w_field1) TO
ENDIF.
ENDWHILE.
APPEND poitemx.
CLEAR poitemx.
ENDLOOP.
Nessun commento:
Posta un commento