Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

custom fields for bapi_alm_notif_create in extension in not working?

former_member186143
Active Contributor
0 Kudos

I try to implement the bapi bapi_alm_notif_create but I can't get the extensionin fields working.

We have one customer field in QMEL added in structure ZAQMEL

named ZZILART

I found this blog about it but cant believe this dirty sollution is really the way to go for extensionin fields for this bapi? is there another sollution and why is it in the bapi if it doesn't work anyway? documentation as usual also not clear on how to use it.

https://blogs.sap.com/2013/12/11/handling-customer-fields-in-bapis-which-doesnt-have-extension-struc...

thanks for any clue how to solve this.

1 ACCEPTED SOLUTION
2 REPLIES 2

Thanks Raymond, I have implemented the note and extended the table BAPI_TE_QMEL and RIQS5

for future reference if more developers have the same problem here also the example code

ls_extensionin-structure = 'BAPI_TE_QMEL'.

*fields for extension are concatenated according to structure BAPI_TE_QMEL

ls_extensionin-valuepart1+12(3) = iv_ilart.
DATA ls_str(10000).
data: ls_cust_cs_fields type ZST_CS_CUSTOMHEADER.

ls_str = ls_extensionin-valuepart1.
ls_cust_cs_fields = IS_CUSTOM_FIELDS.


FIELD-SYMBOLS <fs1>.
DATA len TYPE i.
DATA offs TYPE i.
offs = 15.
DO .
  ASSIGN COMPONENT sy-index OF STRUCTURE ls_cust_cs_fields TO <fs1>.
  IF sy-subrc <> 0.
    EXIT.
  ENDIF.
  DESCRIBE FIELD <fs1>  LENGTH len in CHARACTER MODE.
  MOVE <fs1> TO ls_str+offs(len).
  offs = offs + len + 1.
ENDDO.


ls_extensionin-valuepart1 = ls_str(240).
ls_extensionin-valuepart2 = ls_str+240(240).
ls_extensionin-valuepart3 = ls_str+480(240).
append ls_extensionin to lt_extensionin.

<br>