Application Development 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: 

Need BAPI for MD02

Former Member
0 Kudos

Hello,

Can any one give me the BAPI for following transaction

MD02 - MRP RUN

Thanks in Advance.

Haritha

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Use "BAPI_MATERIAL_PLANNING".

Neha Shukla

5 REPLIES 5

Former Member
0 Kudos

Use "BAPI_MATERIAL_PLANNING".

Neha Shukla

Former Member
0 Kudos

Hi.

goto MD02->SYSTEM-->STATUS.

goto the program(SAPMM61X) attributes.

u'll find package of the application.

in se80 display the above package.

in that goto busi.engineering>busi.obj.types>T024D<--.

in the object types ,u'll find interfaces.

try with those....

thanks.

rajesh

Former Member
0 Kudos

HI

TABLES: MARC,

MARA.

      • DO NOT CHANGE - the generated data section - DO NOT CHANGE ***

  • If it is nessesary to change the data section use the rules:

  • 1.) Each definition of a field exists of two lines

  • 2.) The first line shows exactly the comment

  • '* data element: ' followed with the data element

  • which describes the field.

  • If you don't have a data element use the

  • comment without a data element name

  • 3.) The second line shows the fieldname of the

  • structure, the fieldname must consist of

  • a fieldname and optional the character '_' and

  • three numbers and the field length in brackets

  • 4.) Each field must be type C.

      • Generated data section with specific formatting - DO NOT CHANGE ***

data: begin of record OCCURS 0,

  • data element: MATNR

MATNR_001(018),

  • data element: WERKS_D

WERKS_002(004),

  • data element: VERSL

VERSL_003(005),

  • data element: BANER

BANER_004(001),

  • data element: LIFKZ

LIFKZ_005(001),

  • data element: DISER

DISER_006(001),

  • data element: PLMOD

PLMOD_007(001),

  • data element: TRMPL

TRMPL_008(001),

  • data element: PLALL

PLALL_009(001),

  • data element: ANZLS

ANZLS_010(001),

end of record.

      • End generated data section ***

DATA: D_LINE(5) TYPE N.

SELECT-OPTIONS: S_MATNR FOR MARC-MATNR MEMORY ID M01.

SELECT-OPTIONS: S_WERKS FOR MARC-WERKS OBLIGATORY.

SELECT * FROM MARC WHERE LVORM = SPACE

AND MATNR IN S_MATNR

AND WERKS IN S_WERKS.

CLEAR MARA.

SELECT SINGLE * FROM MARA WHERE MATNR = MARC-MATNR

AND MTART IN ('HALB',

'FERT').

IF SY-SUBRC <> 0. CONTINUE. ENDIF.

RECORD-MATNR_001 = MARC-MATNR.

RECORD-WERKS_002 = MARC-WERKS.

RECORD-VERSL_003 = 'NETCH'.

RECORD-BANER_004 = 2.

RECORD-LIFKZ_005 = 3.

RECORD-DISER_006 = 1.

RECORD-PLMOD_007 = 3.

RECORD-TRMPL_008 = 2.

RECORD-PLALL_009 = 'X'.

RECORD-ANZLS_010 = 'X'.

ADD 1 TO D_LINE.

WRITE:/ D_LINE NO-ZERO, RECORD-MATNR_001, RECORD-WERKS_002.

APPEND RECORD.

CLEAR RECORD.

ENDSELECT.

include bdcrecx1.

start-of-selection.

perform open_group.

LOOP AT RECORD.

perform bdc_dynpro using 'SAPMM61X' '0150'.

perform bdc_field using 'BDC_CURSOR'

'RM61X-MATNR'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RM61X-MATNR'

record-MATNR_001.

perform bdc_field using 'RM61X-WERKS'

record-WERKS_002.

perform bdc_field using 'RM61X-VERSL'

record-VERSL_003.

perform bdc_field using 'RM61X-BANER'

record-BANER_004.

perform bdc_field using 'RM61X-LIFKZ'

record-LIFKZ_005.

perform bdc_field using 'RM61X-DISER'

record-DISER_006.

perform bdc_field using 'RM61X-PLMOD'

record-PLMOD_007.

perform bdc_field using 'RM61X-TRMPL'

record-TRMPL_008.

perform bdc_field using 'RM61X-PLALL'

record-PLALL_009.

perform bdc_field using 'RM61X-ANZLS'

record-ANZLS_010.

perform bdc_dynpro using 'SAPMSSY0' '0120'.

perform bdc_field using 'BDC_OKCODE'

'=XBAC'.

perform bdc_transaction using 'MD02'.

ENDLOOP.

perform close_group.

*--- End of Program

Former Member
0 Kudos

HI

check

http://www.planetsap.com/LIST_ALL_BAPIs.htm

TIP :- Suppose you want to find the bapi for creating a sales order, you usually use transaction VA01 for this.

Start va01 go to system-->status

Double click transaction VA01

Double click on package

Read the application component. (this is SD-SLS Sales)

Then open the transaction BAPI

Sales and distribution>Sales>sales order --> createfromdat2

Adding small screen shots to my TIP.

After finding the Application Component go to BAPI and check with the same path

what we got SD-> SLS Sales

You need to go to BAPI tcode

you will find the application path as i mentioned

goto Sales and Distribution

click on createfromdat2 and check the BAPI

Rewards if useful...................

Former Member
0 Kudos

thanks