cancel
Showing results for 
Search instead for 
Did you mean: 

Help :- BAPI or BATCH Input for VA01 / VA02

Former Member
0 Kudos
557

Hi People,

I bet you know this one, I am new to ABAP Programming and following is my problem .

My piece of code is

1. To identify and read (some type of) stock transfers that meet a certain criteria and

2. create/change sales orders for all the ST's (from above), depending upon proprietary requirements.

I was told that Batch input should be used for the transaction VA01 / VA02 which I found very cumbersome. I have rather decided to use BAPI 'BAPI_SALESORDER_CREATEFROMDAT2'.

Now that I have the program structure in mind I ask myself,

1. Is BATCH input / BAPI good ? Errorhandling in both ?

2. If I go on with the BAPI, what would be the standard method for error handling / monitoring in case of errors. This is of interest to me because my program would run in background and as you have might have guessed does mass processing. how do I deal with mass processing of Status Messages ?

Help me out !!

TIA,

ZAM

Message was edited by: ZAMUser

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

BAPI or Batch Input? - Depends on how you want to handle errors:

If End-User has to correct values/data to create the order sucessfully then Batch-Input is preferrable. You create the data, and if order creation fails, the data is still accessible (via SM35) for manual correction.

Greetings Jochen

0 Kudos

Hi,

Using the BAPI FM is good. And u can use the 'Application Log' function modules for error handling, as suggested by 'Sergei.. This FM's has the nice interface to display messages ..

Regards,

Srini S

VXLozano
Active Contributor
0 Kudos

If not all, a lot of BAPI's use to return a structure or table called RETURN. Check the info on that structures to catch your errors.

I learned it from a work colleague:

- I call the BAPI activating the "run test mode" option

- I check the RETURN table/structure looking for an E(rror) message

- If no errors, I recall the BAPI without the test option and do the COMMIT...

Wish it helps,

Vic

sergey_korolev
Active Contributor
0 Kudos

For mass processing of error messages you might find useful a set of function modules with names starting with BAL* - Application log. They are quite well documented, see FM documentation.

Former Member
0 Kudos

Hi Sergei,

Thanks for your remarks. I have tried out your solution, from what I have seen in the few tests that I made right away. Do u think this can be that helpful to the end-user. I can understand showing up the Application log to the administrator woould be very helpful but to the naive user. Anyway I would show up the first prototype to my team lead and see what comes up next.

Just out of interest, Is there any other way of doing this?

thanks once again

ZAM

Message was edited by: ZAMUser

sergey_korolev
Active Contributor
0 Kudos

Yes, I agree that huge list of messages could look frightful. But what to do if that naive user wants to know all the reasons?

Thankfully there are tools to make the log more structural, for example you can make it hierarchical. Also you can supplement each message with specific context - arbitrary value of predefined DDIC type which can help to analyze reasons more thoroughly.

Former Member
0 Kudos

Hi Sergei,

Thanks for your posts. I should rather rename this topic to Application log. Anyways, I need a tip from you or anyone who knows it. This is cosmetic thing but still !!

I am able to create / add / display logs. But the problem is I can either display all the logs at once or no messages at all.(using the display profile). This makes the user select to go and select the log from the tree to display the particular log.

Q:- Can I not display the log created at the very last in the tree??

TIA,

ZAM

Message was edited by: ZAMUser