Skip to Content
avatar image
Former Member

Update a structure table

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.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Nov 02, 2016 at 03:50 PM

    Hi

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

    Max

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 02, 2016 at 09:18 PM

    Hi Max,

    What do you mean? Can you share an example?

    Best Regards,

    Raynard

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 10 at 04:57 PM

    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.
    Add comment
    10|10000 characters needed characters exceeded

  • Oct 10 at 04:32 PM

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

    Thanks in advance.

    Daniel

    Add comment
    10|10000 characters needed characters exceeded