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: 

Any wrong with my code?

Former Member
0 Kudos

I have following code in order to update customer field in EBAN, but it shows ABAP dump. Anything is wrong?

DATA: it_extension TYPE STANDARD TABLE OF bapiparex.
DATA: wa_extension TYPE bapiparex.
DATA: wa_bapi_te_mereqitem TYPE bapi_te_mereqitem.
wa_bapi_te_mereqitem-preq_item = '00010'.
wa_bapi_te_mereqitem-zpernr = '12345678'.

MOVE:
wa_bapi_te_mereqitem-preq_item TO wa_extension-valuepart1+0(5),
wa_bapi_te_mereqitem-zpernr    TO wa_extension-valuepart1+5(8).

MOVE 'BAPI_TE_MEREQITEM ' TO wa_extension-structure.
APPEND wa_extension TO it_extension.
CALL FUNCTION 'BAPI_PR_CHANGE'
  EXPORTING
    prnumber                    = '0010012923'
 TABLES
   extensionin                 = it_extension      .
COMMIT WORK AND WAIT .

Edited by: Matt on Oct 15, 2009 10:50 AM - added tags

1 ACCEPTED SOLUTION

Sm1tje
Active Contributor
0 Kudos

What is the dump saying?

I guess if you get a short dump, there definitely is something wrong with your code, don't you think.

BTW: Not a very meaning full Subject title (forum rules!!).

16 REPLIES 16

Sm1tje
Active Contributor
0 Kudos

What is the dump saying?

I guess if you get a short dump, there definitely is something wrong with your code, don't you think.

BTW: Not a very meaning full Subject title (forum rules!!).

Former Member
0 Kudos

NoW, in another system, there is no abap dump, but the field is not updated in table EBAN.

Sm1tje
Active Contributor
0 Kudos

Does this BAPI have a return table of type BAPIRET2? If so, after executing the BAPI retrieve the (error) message in this structure (table) and see if anything is wrong.

BTW: You should never do COMMIT WORK AND WAIT, without evaluating the return code (return table).

Former Member
0 Kudos

Hello ,

Kindely tell the error analysis in dump error .

Regards,

Shrikant.

nabheetscn
Active Contributor
0 Kudos

Hello,

Please pass the parameter RETURN in tables and see what is it filled with.

This will let you know if some error has occureed or what.In case nothing happens please let me know .

Regards,

Nabheet Madan

0 Kudos

RUTURN saying the BAPI is called successfully, but the field is not updated, does anyone know how to use this BAPI_PR_CHANGE to update the customer field in EBAN?

kesavadas_thekkillath
Active Contributor
0 Kudos

Its impossible to suggest a solution without dump details !!!

former_member187457
Active Contributor
0 Kudos

Check the bapi field to which u r passing the values...

like 'prnumber' in my sytem it is not 'prnumber' .....it is 'number' only.....

If u have copied the code or bapi ...then please call the bapi again freshly in ur code and check.....

because i copied ur code and it gave me dump....

so i called bapi freshly asn i found this difference....

that may be the problem.....

Please check..

thnx

Rahul

Edited by: Rahul Keshav on Oct 15, 2009 12:20 PM

0 Kudos

Sorry my question is not ABAP dump now, maybe it's the system problem. In another system, there is no ABAP dump, but the field is not updated in the table EBAN.

0 Kudos

try to use...

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

after the bapi...

thnx

Rahul

kesavadas_thekkillath
Active Contributor
0 Kudos

I hope you have missed this

also mark process extension as true in your BAPI import parameter

MOVE abap_true TO ls_processextension.

data:gc_structure TYPE te_struc VALUE 'ZBAPI_TE_CMS_EQUIPMENT'.

data:ls_exten_value TYPE zbapi_str_cms_equipment.

DATA:lt_extensionin TYPE STANDARD TABLE OF bapiparex.

DATA:ls_extensionin LIKE LINE OF lt_extensionin.

The custom structure consists of fields

MOV_GUID

ZZEQUIP_STATUS.

In your case create a zstructure with fields

prnumber

preq_item

zpernr

move:

gc_structure TO ls_extensionin-structure,

ps_header-zzequip_status TO ls_exten_value-zzequip_status,

ls_exten_value TO ls_extensionin-valuepart1.

APPEND ls_extensionin TO lt_extensionin.

MOVE abap_true TO ls_processextension.

Edited by: Keshu Thekkillam on Oct 15, 2009 12:34 PM

0 Kudos

There is no process extension parameter in BAPI_PR_CHANGE

I also tried CALL FUNCTION 'BAPI_TRANSACTION_COMMIT', but it doesn't work.

kesavadas_thekkillath
Active Contributor
0 Kudos

You must also implement the Business Addin for this.

these links will help you a lot

link:[http://help.sap.com/saphelp_nw04/Helpdata/EN/c3/4099ac8b8911d396b70004ac96334b/content.htm]

link:[http://help.sap.com/saphelp_46c/helpdata/en/c3/4099a68b8911d396b70004ac96334b/content.htm]

nabheetscn
Active Contributor
0 Kudos

Hello,

Pass the following parameters also

PRHEADERX ( This is for header data if you want to change.)BAPIMEREQHEADERX Change Parameter for Enjoy Purchase Requisition - Header

PREQ_NO BAPIUPDATE CHAR 1 0 Updated information in related user data field

PR_TYPE BAPIUPDATE CHAR 1 0 Updated information in related user data field

CTRL_IND BAPIUPDATE CHAR 1 0 Updated information in related user data field

GENERAL_RELEASE BAPIUPDATE CHAR 1 0 Updated information in related user data field

CREATE_IND BAPIUPDATE CHAR 1 0 Updated information in related user data field

ITEM_INTVL BAPIUPDATE CHAR 1 0 Updated information in related user data field

LAST_ITEM BAPIUPDATE CHAR 1 0 Updated information in related user data field

AUTO_SOURCE BAPIUPDATE CHAR 1 0 Updated information in related user data field

MEMORY BAPIUPDATE CHAR 1 0 Updated information in related user data field

This will set the parameter and update the header data.

Use PRITEMX parameter in tables to update the item level data BAPIMEREQITEMX Change Parameter for Enjoy Purchase Requisition - Item Data

Reagrds,

Nabheet Madan

kesavadas_thekkillath
Active Contributor
0 Kudos

check this link too

Former Member
0 Kudos

I want to use FM 'ME_UPDATE_REQUISITION' to update the field in EBAN, why it doesn't work?

 

data: xeban LIKE TABLE OF  ueban WITH HEADER LINE,
xebkn LIKE TABLE OF uebkn WITH HEADER LINE,
yeban LIKE TABLE OF  ueban WITH HEADER LINE,
yebkn LIKE TABLE OF  uebkn WITH HEADER LINE.

PARAMETERS p_prno TYPE eban-banfn.
SELECT * INTO CORRESPONDING FIELDS OF TABLE xeban
FROM eban WHERE banfn = p_prno.

SELECT * INTO CORRESPONDING FIELDS OF TABLE xebkn
FROM ebkn WHERE banfn = p_prno.

yeban = xeban.
yebkn = xebkn.

LOOP AT xeban .
 xeban-kz = 'U'.
  xeban-zpernr = '99990712'.
  MODIFY xeban.
ENDLOOP.

CALL FUNCTION 'ME_UPDATE_REQUISITION'
  TABLES
    xeban = xeban
    xebkn = xebkn
    yeban = yeban
    yebkn = yebkn.

CALL FUNCTION 'ME_UPDATE_REQUISITION_CHNGDOC'
  TABLES
    xeban = xeban
    xebkn = xebkn
    yeban = yeban
    yebkn = yebkn.


CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    wait = 'X'.

Edited by: yu huali on Oct 16, 2009 7:29 PM