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

BAPI_PR_CHANGE using extensionin

Former Member
0 Likes
3,922

Hi experts, i'm trying to use BAPI_PR_CHANGE to modify an append field in EBAN (named ZBUYER) but i can't

I see 'BAPI_TE_MEREQITEM' structure and contains the desired field (ZBUYER)

this is my code, hope somebady brings ligth to this, thanks

REPORT zpruebamodifzbuyer.

TABLES: eban.

SELECTION-SCREEN: BEGIN OF BLOCK a1.

PARAMETERS: p_banfn LIKE eban-banfn DEFAULT '10000001'.

SELECTION-SCREEN: END OF BLOCK a1.

DATA: lv_posic LIKE eban-bnfpo,

ls_cabecera LIKE bapimereqheader,

ls_cabecerax LIKE bapimereqheaderx,

ls_posic LIKE bapimereqitem,

lt_posic LIKE bapimereqitem OCCURS 0 WITH HEADER LINE,

ls_posicx LIKE bapimereqitemx,

lt_posicx LIKE bapimereqitemx OCCURS 0 WITH HEADER LINE,

ls_extin LIKE bapiparex,

lt_extin LIKE bapiparex OCCURS 0 WITH HEADER LINE,

ls_item LIKE bapi_te_mereqitem,

ls_itemx LIKE bapi_te_mereqitemx..

AT LINE-SELECTION.

SET PARAMETER ID 'BAN' FIELD p_banfn.

CALL TRANSACTION 'ME53N' AND SKIP FIRST SCREEN.

START-OF-SELECTION.

ls_cabecera-preq_no = p_banfn.

ls_extin-structure = 'BAPI_TE_MEREQITEM'.

ls_item-preq_item = '00010'.

ls_item-zbuyer = 'FELIX'.

ls_extin-valuepart1 = ls_item.

APPEND ls_extin TO lt_extin.

CLEAR ls_extin.

ls_extin-structure = 'BAPI_TE_MEREQITEMX'.

ls_itemx-preq_item = '00010'.

ls_itemx-zbuyer = 'X'.

ls_extin-valuepart1 = ls_itemx.

APPEND ls_extin TO lt_extin.

CALL FUNCTION 'BAPI_PR_CHANGE'

EXPORTING

number = ls_cabecera-preq_no

  • PRHEADER =

  • PRHEADERX =

  • TESTRUN =

  • IMPORTING

  • prheaderexp =

TABLES

  • RETURN =

  • pritem = lt_posic

  • pritemx = lt_posicx

  • PRITEMEXP =

  • PRITEMSOURCE =

  • PRACCOUNT =

  • PRACCOUNTPROITSEGMENT =

  • PRACCOUNTX =

  • PRADDRDELIVERY =

  • PRITEMTEXT =

  • PRHEADERTEXT =

extensionin = lt_extin

  • EXTENSIONOUT =

  • PRVERSION =

  • PRVERSIONX =

  • ALLVERSIONS =

.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

FORMAT HOTSPOT ON.

WRITE: 'Se ha modificado la solicitud de pedido', p_banfn.

FORMAT HOTSPOT OFF.

2 REPLIES 2
Read only

Former Member
0 Likes
1,931

Hi,

I am also stuck in same issuse . If u got any soln on please post it on SDN.

Thanks,

Vikram.

Read only

Former Member
0 Likes
1,931

I solved this problem implementing the ME_BAPI_PR_CUST badi, exactly using the method MAP2I_EXTENSIONIN and putting following code

ch_struc = im_container.