02-28-2007 11:48 AM
Dear All
I desperately need an answer for the unexpected problem I am facing.
I am trying to create Delivery for a given SalesOrder via BDC using Call Transaction (VL01N) method.
The delivery is getting created without any error but the BDCMSGCOLL table is not getting populated with the success message.
I am not being able to display the Success Message in the return table.
But incase of any error, the message table is getting populated.
Kindly Advise.
Dev
02-28-2007 11:51 AM
First things first.
YOu cannot do a BDC for VL01N transaction as it is a enjoy transaction.
Try to do the same BDC for VL01 instead.
Regards,
Ravi
02-28-2007 12:02 PM
First of all let me thank you for your expert response.
I was aware of the fact that BDCs can not be used for enjoy transactions.
But i tried with VL01 also. But in this case, the error message table is getting populated with the error "The transaction is Outdated".
Well I can omit that from display but still the success message i.e "The ......... delivery is created ".
It can be done by checking sy-subrc and write statement but I need to know why the BDCMSGCOLL is not getting populatd with the success message.
Dev
02-28-2007 1:05 PM
Hi Debabrata,
In general the BDCMSGCOLL table will get populated by the messages that you normally see when you do the transaction manually.
If you get the succes message in Vl01n manually then you should get it in the BDCMSGCOLL as well.
Just check if your code has any loop at WHERE condition that would show only ERROR/WARNING messages?
Regards,
Ravi
02-28-2007 1:13 PM
SET PARAMETER ID 'VL' FIELD space.
CALL TRANSACTION 'VL01' USING g_t_bdcdata OPTIONS FROM g_wa_ctu_params
MESSAGES INTO g_t_bdcmsgcoll.
IF sy-subrc = '0'.
CLEAR g_flag. "Clear Flag Value.
GET PARAMETER ID 'VL' FIELD DELIVERY.
IF DELIVERY IS INITIAL.
g_flag = 'X'.
endif.
ELSE.
g_flag = 'X'. "Flag value set to 'X' to Raise Exception.
ENDIF. "IF sy-subrc = '0'.
&----
*& Filling Messages occured during BDC into l_t_return.
&----
CLEAR g_val.
DESCRIBE TABLE g_t_bdcmsgcoll LINES g_val. "Calculating number of filled lines of the table.
IF g_val <> 0.
LOOP AT g_t_bdcmsgcoll INTO g_wa_bdcmsgcoll. "Fetching Message Text using Message-Id & Message-No.
CLEAR g_err_log.
g_msgno = g_wa_bdcmsgcoll-msgnr.
CALL FUNCTION 'WRITE_MESSAGE'
EXPORTING
msgid = g_wa_bdcmsgcoll-msgid
msgno = g_msgno
msgty = g_wa_bdcmsgcoll-msgtyp
msgv1 = g_wa_bdcmsgcoll-msgv1
msgv2 = g_wa_bdcmsgcoll-msgv2
msgv3 = g_wa_bdcmsgcoll-msgv3
msgv4 = g_wa_bdcmsgcoll-msgv4
IMPORTING
messg = g_err_log.
MOVE-CORRESPONDING g_err_log TO g_wa_download.
APPEND g_wa_download TO g_t_download. "Storing messages text into table that occured during BDC.
ENDLOOP.
DELETE ADJACENT DUPLICATES FROM g_t_download.
ENDIF. "IF g_val <> 0.
l_t_return[] = g_t_download[].
This is my piece of code. please let me know the error.
02-28-2007 11:55 AM
Hi,
For enjoy transaction we can't do BDC. Please use BDC for VL01.
Regards
Bhupal Reddy
02-28-2007 11:55 AM
check sy-subrc.
if sy-subrc = 0.
"Display the message, using write statement or populating into itab.
endif.
03-01-2007 5:00 AM
Hi Debabrata,
I dont know why your Call Transaction stmt is not capturing any msgs.
But If u want to generate a log on the BDC to show what delivery is created for what sales order number, then check the sy-subrc on the Call Transaction Stmt. If it is 0 then fetch a record from LIPS where VGBEL = Sales Order number.
You can retrieve the Delivery Number from LIPS and relate it to Sales Order number and display it.
Reward points, if helpful.
03-02-2007 1:06 PM
I thank you for your response..
But that was not my problem.
My Problem is that the Success Message is coming into the BDCMSGCOLL
structure.