cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Update a structure table

Raynard_OFID
Discoverer
0 Kudos
517

Hi Guys,

I need your assistance on how I can update a structure table within a BADI implementation. The following coding we have define. Any idea how we fill up the append structure? Thank you. Best Regards, Raynard

method IF_EX_BNK_UI_ENHANDE~UI_ITEM.
DATA: BEGIN OF BNK_BTC_ITEM_UI,
 VBLNR TYPE BNK_BTC_ITEM_UI-VBLNR,
 ZREFTXT TYPE BNK_BTC_ITEM_UI-ZREFTXT,
END OF BNK_BTC_ITEM_UI.

data: field1(30) type c.

data: field2(30) type c.

data: wa_ct type ttfieldname.

data: idxx1 type sy-index.
DATA: BEGIN OF REGUP,
 VBLNR TYPE REGUP-VBLNR,
 SGTXT TYPE REGUP-SGTXT,END OF REGUP.

* clear idxx1.

SELECT VBLNR SGTXT FROM REGUP INTO CORRESPONDING FIELDS OF REGUPWHERE VBLNR = CF_BNK_BTC_ITEM_UI-VBLNR.

* idxx1 = idxx1 + 1.

endselect.

if sy-subrc = 0.

WRITE regup-sgtxt to CF_BNK_BTC_ITEM_UI-ZREFTXT.

write 'BNK_BTC_ITEM_UI-ZREFTXT' to field1.

write 'BNK_BTC_ITEM_UI-ZREFTXT' to field2.

insert field1 into CT_BNK_moni_fields index 1.

insert field2 into CT_BNK_app_fields index 1.

else.clear regup.

endif.
endmethod.

Accepted Solutions (0)

Answers (4)

Answers (4)

juan_suros
Contributor
0 Kudos

In S/4 you could do this:

CT_BNK_MONI_FIELDS = VALUE #( ( 'BNK_BTC_ITEM_UI-ZREFTXT' ) ).
CT_BNK_APP_FIELDS  = VALUE #( ( 'BNK_BTC_ITEM_UI-ZREFTXT' ) ).

In ECC you could do this:

DATA: wa TYPE fieldname.
wa = 'BNK_BTC_ITEM_UI-ZREFTXT'.
APPEND wa TO: CT_BNK_MONI_FIELDS, CT_BNK_APP_FIELDS.
Former Member
0 Kudos

Hi gurus, I'm facing the same problem, please could you tell me how you solve this issue?

Thanks in advance.

Daniel

Raynard_OFID
Discoverer
0 Kudos

Hi Max,

What do you mean? Can you share an example?

Best Regards,

Raynard

Former Member
0 Kudos

Hi

You need to use an headerline structurated like BADI table, so you can fill it and then append it to the table

Max