05-23-2005 10:19 AM
How can I perform some action in a call transaction session depending on the screen, for example, in the same session, for one set of data, an error can occur and stop my transaction. How can I pass this point ?
I am calling the transaction VL06G, make the selection, select all deliverys in the next screen, and push the button 'Post goods issue'. If an error occur, the session is over and the remaining deliverys are not processed. Please, give me a solution.
05-23-2005 10:39 AM
05-23-2005 10:46 AM
No help, I know what means mode 'E'.
My question is how do I pass them...
05-23-2005 11:07 AM
Hi,
If you want to do step by step , use 'A'.
Otherwise you can collect the error messages in an internal table.
Check this also.
05-23-2005 10:52 AM
05-23-2005 11:12 AM
I think you don't understand what I'm trying to explain here.
Yes, i looked at your code, and I undestand what you have done there. Processing in mode 'N'... ok, if one error appears, the processing continues, and is registered in a batch session . But....
If the processing is stoped when an error occurs, how can I continue with the rest of the operations ?
05-23-2005 11:28 AM
Hi,
Let me know if it is correct.
You want to process the transaction irrespective of error and then display all the error messages at a strecth.
If it is so, this code sample is useful.
Call transaction to update customer instalment text
CALL TRANSACTION 'ME22' USING bdc_tab MODE 'N' UPDATE 'S'
MESSAGES INTO messtab.
Check if update was succesful
IF sy-subrc EQ 0.
ADD 1 TO gd_update.
APPEND wa_ekko TO it_success.
ELSE.
Retrieve error messages displayed during BDC update
LOOP AT messtab WHERE msgtyp = 'E'.
Builds actual message based on info returned from Call transaction
CALL FUNCTION 'MESSAGE_TEXT_BUILD'
EXPORTING
msgid = messtab-msgid
msgnr = messtab-msgnr
msgv1 = messtab-msgv1
msgv2 = messtab-msgv2
msgv3 = messtab-msgv3
msgv4 = messtab-msgv4
IMPORTING
message_text_output = w_textout.
ENDLOOP.
Build error table ready for output
wa_error = wa_ekko.
wa_error-err_msg = w_textout.
APPEND wa_error TO it_error.
CLEAR: wa_error.
ENDIF.
For more information, check
http://www.sapdevelopment.co.uk/bdc/bdc_ctcode.htm
Regards,
J.Jayanthi
05-23-2005 11:30 AM
Hi Ivanov,
Short answer is - you can't.
If the BDC session encounters an error, you can't do conditional processing to say, ok I'll skip this error and go on doing the other stuff I wanted to do. It doesn't work that way. A BDC is a pre-programmed macro and once its set up you can't alter the way it will behave mid transaction.
The only way to do this, is to detect the error from your CALL TRANSACTION statement and then modify the BDC table to address the error and then issue another CALL TRANSACTION.
If you submit multiple transactions on one BDC session in SM35 it will continue with the other transactions if one fails, but it wont skip over errors within a transaction and keep going (unless you intervene manually). It doesn't work like that.
Hope that helps.
Brad
05-23-2005 12:16 PM
yes, this is what I thought too, but I needed a confirmation some how.
Thanks Brad, precisely like usual.....
thaks again...
05-23-2005 12:43 PM
Hi Ivanov,
No problems. How did you go with the availability checking issue?
Brad
05-23-2005 2:01 PM
What you are trying to do is not possible but check if this workaround is possible( Unless performance is not a major issue ) -
I've not gone through your Xn so not sure.
On the next screen instead of selecting all deliveries,
select one by one. In BDC recording select only the top delivery --> process it --> transaction Over.
Start again. Now since the earlier delivery is processed it should not appear in the list.
Repeat the procedure.
Here CALL TRANSACTION will be called for each delivery.
Till it gives you the message "No Deiliveries Selected".
Thanks,
Ram
05-23-2005 2:35 PM
Sorry I don't know how to edit the message and I've a few more points for my last suggestion.
In case of error you need to change your next BDCDATA so that next delivery selected will not be the top but will be at the 2nd position. and so on...
As Top delivery will be the delivery in error and should not be re-processed.
Thanks,
Ram