Skip to Content
0
Jan 28, 2016 at 08:32 AM

How to fill dynamic fields of a Structure with a Condition?

1425 Views

Hello,

im using the Bapi ' BAPI_PO_CREATE1' and i would like to fill the fields of the update structure or tables dynamic.

My code:

* fill header structure

ls_po_header-po_number = '9000000020'.

ls_po_header-comp_code = '1000'.

ls_po_header-doc_type = 'ZFIT'.

ls_po_header-item_intvl = '00001'.

ls_po_header-vendor = '1000'. "000000001000

ls_po_header-pmnttrms = '0001' .

ls_po_header-purch_org = '1000' .

ls_po_header-pur_group = '001' .

ls_po_header-currency = 'EUR'.

* Headerx Struktur füllen (Update Struktur)

ls_po_headerx-po_number = 'X'.

ls_po_headerx-comp_code = 'X'.

ls_po_headerx-doc_type = 'X'.

ls_po_headerx-item_intvl = 'X'.

ls_po_headerx-vendor = 'X'.

ls_po_headerx-pmnttrms = 'X'.

ls_po_headerx-purch_org = 'X'.

ls_po_headerx-pur_group = 'X'.


My goal:


To fill the fields of the structure ls_po_headerx with 'X' if in the corresponding fields of the structure ls_po_header is not inital.


Same mission i got on the internal table lt_po_items and lt_po_itemsx.


Good Luck!