2009 Feb 11 6:57 AM
Hi ,
Iam updating the materail using MSCN tcode in BDC.
When the material is updated successfully through BDC.
I have to capture the Material document number of that particular material.
Please suggest me how to get the material documnet number of material which is updated through 'BDC'.
Thnaks in advance.
2009 Feb 11 7:06 AM
In BDC call transaction use Messages into addition.
else. use FM FORMAT_MESSAGES to get the material number after the sucessful execution of transaction.
In BDC call transaction use Messages into addition.
else. use FM FORMAT_MESSAGES to get the material number after the sucessful execution of transaction.
2009 Feb 11 7:06 AM
In BDC call transaction use Messages into addition.
else. use FM FORMAT_MESSAGES to get the material number after the sucessful execution of transaction.
2009 Feb 11 7:07 AM
Hi Vinay
You may capture the messaggs generated during BDC by adding MESSAGES INTO itab (type msgcoll).
Then you can also use the FM MESSAGE_PREPARE.
Pushpraj
2009 Feb 11 7:09 AM
Hi,
After writing the call transaction,use the FM FORMAT_MESSAGES.
LOOP AT t_msg INTO fs_msg.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = fs_msg-msgid
lang = sy-langu
no = fs_msg-msgnr
v1 = fs_msg-msgv1
v2 = fs_msg-msgv2
v3 = fs_msg-msgv3
v4 = fs_msg-msgv4
IMPORTING
msg = w_message
EXCEPTIONS
not_found = 1
OTHERS = 2.
WRITE:
/ W_message.
ENDLOOP.
Declare the fieldstring fs_msg and table t_msg,then the values will be populated.
Regards,
jaya
2009 Feb 12 1:19 PM
Thankyou jayapradha,
But in my case when iam using call transaction for MSC2N.
It is not populating any messages.
even though iam getting the sy-subrc value as 0.
2009 Feb 12 1:39 PM
Hi Vinay,
When you maually post it do you see any message that a material doc XXXXX has been create messages? If yes then check MEssage Table in Call Transaction with type S.
If no then use a select query either after each call transaction or after completing your whole process. The Material Documents are stored in Table MSEG and MKPF.
Thanks,
Prashanth
2009 Feb 12 2:11 PM
Thankyou prashanth.
I did the same thing.
But can you give me the reason why it is not showing in messages. any idea.
2009 Feb 12 2:13 PM
can you please show me the select query how we have to write.
here iam using matnr,plant, storagelocation and batch.
using these parametes how we will get the material doc number from MKPF.
Please suggest me prashanth.
2009 Feb 12 2:20 PM
Hi,
Check in MSEG you have Material, Plant, Storage Location and Batch and along with this you use Sy-uname and Date and also time since there could be many Doc available for Material, plant storage Loc and Batch combination.
The reason why you don't get those details captured could be because Material Document gets created in Background and you don't receive the message for that. This is my guess and could be one of the reasons.
Thanks,
Prashanth.
2009 Feb 12 1:24 PM
Hi Vinay,
You can also use BDCMSGCOLL table and you can cature your messgae.
Here s the logic.
data :
t_msg type standard table of bdcmsgcoll with headerline.
Now you can loop at this table and all youe messages will be catured by the fields MSGV1,MSGV2,MSGV3 and MSGV4.
You ll get it.
Much Regards,
Amuktha.
2009 Feb 12 1:35 PM
2009 Feb 12 2:14 PM
Hi,
I had gone through the transaction MSC2N which is to change the batch and you have written BDC to update the material Batch details.
After the BDC session, you can use BAPI_BATCH_GET_DETAIL to get the status of BDC run (run successfully or not), return table should have zero records for the successful update and PROD_DATE in BATCHATTRIBUTES export table should show the current date.
(another suggestion is use BAPI_BATCH_CHANGE instead of BDC)
Hope this helps.
Thank you.
Nagarajan
2009 Feb 12 2:20 PM
Nagarajan thakyou for your reply.
But here i have to change the material old status to new status.
I have to change the old status from restricted to Unrestricted and vice versa.
I think this can be possible through BDC.
But when iam changing the status the material status is changing successfully.
But it is not capturing in any messages.
but here when ever the material is updated successfully i need to capture that material documnet number.
Edited by: vinay raj on Feb 12, 2009 3:21 PM
Edited by: vinay raj on Feb 13, 2009 9:26 PM
2009 Feb 13 11:48 PM
2009 Feb 16 6:08 AM
2010 Sep 02 9:04 AM
Hi Vinay,
Im having exactly the same requirement as what you did last time, not sure whether would you mind to share how did you solve the problem, please?
Many thanks in adv.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |