Skip to Content

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

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 02, 2016 at 09:18 PM

    Hi Max,

    What do you mean? Can you share an example?

    Best Regards,

    Raynard

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 10, 2018 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 10, 2018 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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.