Application Development and Automation 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: 
Read only

Field FDLEV in BAPI_ACC_DOCUMENT_POST

luscruz
Participant
0 Likes
772

Hi all,

When I create a document, I'm trying to fill the FDLEV field with BAPI_ACC_DOCUMENT_POST.

For what I saw on other messages, I need to use extension1 table, but it doesn't seem to work.

Anyone can help me?

...

ls_extension-field1 = ps_receivable-itemno_acc.

ls_extension-field2 = 'FDLEV'.

ls_extension-field3 = ps_bseg-fdlev.

APPEND ls_extension TO pt_extension.

...

Thanks in advanced,

Luis Cruz

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
476

Hi

Because u need to implement the BTE RWBAPI01 in order to get the fields transfered by extension:

a) Step one: fill the extensionin:

DATA: ST_EXTENSIONIN,
                itemno_acc type POSNR_ACC
                FDLEV          type BSEG-FDLEV,
           ST_EXTENSIONIN.
               
ST_EXTENSIONIN-ITEMNO_ACC = ps_receivable-itemno_acc. 
ST_EXTENSIONIN-FDLEV = ps_bseg-fdlev.
APPEND ST_EXTENSIONIN TO pt_extension.

B) Step two: get the value from extension (in BTE):

DATA: ST_EXTENSIONIN,
                itemno_acc type POSNR_ACC
                FDLEV          type BSEG-FDLEV,
           ST_EXTENSIONIN.

LOOP AT t_extension.
  MOVE t_extension to ST_EXTENSIONIN.
  READ TABLE IT_ACCIT WITH KEY POSNR = ST_EXTENSIONIN-ITEMNO_ACC.
  IF SY-SUBRC = 0.
     IT_ACCIT-FDLEV = ST_EXTENSIONIN-FDLEV.
     MODIFY T_ACCIT INDEX SY-TABIX.
  ENDIF.
ENDLOOP.

As a structure ST_EXTENSIONIN (to fill the extensionin table) has to be used in two different program, it should be better to define it in dictionary instead of the program.

Max

1 REPLY 1
Read only

Former Member
0 Likes
477

Hi

Because u need to implement the BTE RWBAPI01 in order to get the fields transfered by extension:

a) Step one: fill the extensionin:

DATA: ST_EXTENSIONIN,
                itemno_acc type POSNR_ACC
                FDLEV          type BSEG-FDLEV,
           ST_EXTENSIONIN.
               
ST_EXTENSIONIN-ITEMNO_ACC = ps_receivable-itemno_acc. 
ST_EXTENSIONIN-FDLEV = ps_bseg-fdlev.
APPEND ST_EXTENSIONIN TO pt_extension.

B) Step two: get the value from extension (in BTE):

DATA: ST_EXTENSIONIN,
                itemno_acc type POSNR_ACC
                FDLEV          type BSEG-FDLEV,
           ST_EXTENSIONIN.

LOOP AT t_extension.
  MOVE t_extension to ST_EXTENSIONIN.
  READ TABLE IT_ACCIT WITH KEY POSNR = ST_EXTENSIONIN-ITEMNO_ACC.
  IF SY-SUBRC = 0.
     IT_ACCIT-FDLEV = ST_EXTENSIONIN-FDLEV.
     MODIFY T_ACCIT INDEX SY-TABIX.
  ENDIF.
ENDLOOP.

As a structure ST_EXTENSIONIN (to fill the extensionin table) has to be used in two different program, it should be better to define it in dictionary instead of the program.

Max