‎2009 Mar 22 4:57 AM
Want help regarding migo badi at time of saving i want material document number and i want to include one program at tht time in which i can use material document number..which is generated..so which badi i can use..and how can i do can any one help me...????
‎2009 Mar 22 6:12 AM
Hi,
I had similar requirement,you can use method POST_DOCUMENT of BADI - MB_MIGO_BADI.This will get triggered before saving MIGO and you will get document number here.See the internal table 'IT_MSEG' in this MBLNR field is there in which your generated document number will exist.
You can code like this :
DATA : WA_MSEG TYPE MSEG.
READ TABLE IT_MSEG INTO WA_MSEG INDEX 1.
"WA_MSEG-MBLNR will have the document number
" you can do your processing here
Thanks & Regards,
Rock.
‎2009 Mar 22 6:12 AM
Hi,
I had similar requirement,you can use method POST_DOCUMENT of BADI - MB_MIGO_BADI.This will get triggered before saving MIGO and you will get document number here.See the internal table 'IT_MSEG' in this MBLNR field is there in which your generated document number will exist.
You can code like this :
DATA : WA_MSEG TYPE MSEG.
READ TABLE IT_MSEG INTO WA_MSEG INDEX 1.
"WA_MSEG-MBLNR will have the document number
" you can do your processing here
Thanks & Regards,
Rock.
‎2009 Mar 22 9:35 AM
Thanks but in ecc6 how to create badi can u give me steps.So that i can do..plz..
‎2009 Mar 22 12:58 PM
Hi,
Goto SE18 Select BADI Name radio button.Enter BADI name as "MB_MIGO_BADI".Goto Display mode.Then Goto menu "Implementation" then click create.Then double click on the method "POST_DOCUMENT".Write the code as mentioned in my first reply.Then SAVE & ACTIVATE.Thas it.
Thanks & Regards,
Rock.
‎2009 Mar 24 6:46 AM
READ TABLE IT_MSEG INTO WA_MSEG INDEX 1.
In this given above code its giving error tht the field it_mseg is unknown....
plz help me to solve this error...
‎2009 Mar 24 9:56 AM
Dear Nainesh,
IT_MSEG is not an internal table. So you cant read that using read statement.
It is associated with table type TY_T_MSEG and this table type hasa line type MSEG.
If you want to access any data for IT_MSEG then simply access it directly,
IT_MSEG -<the field name for which you want data>
As in your case you want the document number so use IT_MSEG-MBLNR.
IT_MSEG-MBLNR will contain the document number.
Regards
Arindam
‎2009 Mar 24 10:39 AM
ABOVE ERROR IS SOLV NOW BUT I HAVE ONE MORE QUESTION I WANT TO INCLUDE ONE PROGRAM BUT IS NOT ALLOWING ME BECAUSE THERE IS SOME TABLE AND DATA STATEMENT..AND SO SYS.GIVES ERROR THT U CANT USE TYPE SO I WANT TO USE THT I HAVE PROGRAME ALREADY CREATED SO I JST WANT TO CALL OR INCLUDE THT PRG SO IS IT POSSIBLE FOR ANY EXECUTABLE OR INCLUDE PROGS...
THANKS FOR UR KIND REPLY...
‎2009 Mar 24 11:18 AM
Hello,
you can try to submit your program.
SUBMIT <your prog name> WITH
< pass the parameters>
AND RETURN.
IMPORT <the parameter/internal table you want to import from ur prog> FROM MEMORY ID <'memory Id'>.
Regards
Arindam