Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Migo Problem.

Former Member
0 Likes
955

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...????

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
926

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.

7 REPLIES 7
Read only

Former Member
0 Likes
927

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.

Read only

0 Likes
926

Thanks but in ecc6 how to create badi can u give me steps.So that i can do..plz..

Read only

0 Likes
926

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.

Read only

0 Likes
926

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...

Read only

0 Likes
926

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

Read only

0 Likes
926

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...

Read only

0 Likes
926

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