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

doubt regarding bapi

Former Member
0 Likes
1,216

hi abap experts.

I am working bapi development.  why are we using fm:bapi_transaction_rollback,when error occured how can we see that error then how to update those errors.

thanks,

Balajip

Moderator message - Please search before posting.

Message was edited by: Suhas Saha

7 REPLIES 7
Read only

krishna_k19
Contributor
0 Likes
1,122

Hi Balaji,

      1). BAPI method

      2). Commit Method for committing the work

       3). Roll Back Method for reverting the command.

By using BAPI or method your creating any no.(ex. delivery num.) and it is created successfully then you have to commit the work then only that data will update into data base if suppose any errors happens then system itself won't store the data if requires you can use the Rollback method by using sy-subrc or by return parameter (or return table )

And we can see the errors by using the Return table or return parameters .

Thanks & Regards,

Krishna

Read only

0 Likes
1,122

HI Kiran,

Thanks a lot for quick response.but can you please tell me how can we see the errors  by using the Return table or return parameters.If you dont mind can you elaborate entire bapi.I am new to bapi development.hopt that you understand my posion.

Read only

0 Likes
1,122

Hi,

   As per my knowledge , Bapiret2 will return the details like success as well as failure , etc..,

: S Success, E Error, W Warning, I Info, A Abort in TYPE.

based on that we can display the error messages by using type = 'E'.

basic:

loop bapiret2 into wa_ret2 where type = 'E'.

   write : wa_ret2-MESSAGE_V1 , wa_ret2-MESSAGE_V2.......

endloop.

like this.

this is only for basic we can display by using FM (log display Fm also).

Thanks & Regards,

Krishna

Read only

mayur_priyan
Active Participant
0 Likes
1,122

Hi,

You can normally check whether the BAPI has failed from the Importing parameter and the Return Table. Inorder the get the error occurred during the process, LOOP the return table ( Eg: which has a structure BAPIRET2 ) based on the TYPE field i.e. which displays the error type ( Eg. W - Warning , E - Error ).

This return table contains all the details as follows:

TYPE

ID

NUMBER

MESSAGE

LOG_NO

LOG_MSG_NO

MESSAGE_V1

MESSAGE_V2

MESSAGE_V3

MESSAGE_V4

PARAMETER

ROW

FIELD

SYSTEM

Note: You can use the where-used List for BAPI_TRANSACTION_ROLLBACK in your system for your reference.

Regards,

Mayur Priyan

Read only

0 Likes
1,122

sorry mayure,

I am not getting what you are saying.I opend FM And see where used list but system throughs error

No where-used list possible for this object

Message no. ED339

how to loop return table can you give one example.

my requirement is :I am uploading 500 records  450 records are uploaded .50 records were not updated how can we those error 50 records.how to upadated them.where they 50 records are stored

how to use  these fields I means in loop statement.

what  fields to choose in write statement:

   

  1. TYPE
  2. ID
  3. NUMBER
  4. MESSAGE
  5. LOG_NO
  6. LOG_MSG_NO
  7. MESSAGE_V1
  8. MESSAGE_V2
  9. MESSAGE_V3
  10. MESSAGE_V4
  11. PARAMETER
  12. ROW
  13. FIELD
  14. SYSTEM

Message was edited by: balaji pachipulusula

Read only

mayur_priyan
Active Participant
0 Likes
1,122

Hi,

Please try to position the cursor on the name of the Function module and then try selecting Where-used list.

Read only

0 Likes
1,122

thank you mayure.

I got it.