REPORT ZMM01_RM .
TABLES: mara,
marc,
makt.
DATA: BEGIN OF bdcdata OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA: END OF bdcdata.
DATA: BEGIN OF waRm OCCURS 0,
mtart LIKE mara-mtart,
werks LIKE marc-werks,
lgort LIKE mard-lgort,
maktx LIKE makt-maktx,
meins LIKE mara-meins,
matkl LIKE mara-matkl,
extwg LIKE mara-extwg,
ekwsl LIKE mara-ekwsl,
plifz LIKE marc-plifz,
peinh LIKE mbew-peinh,
stprs LIKE mbew-stprs,
losgr LIKE marc-losgr,
j_4kcsgr LIKE mara-j_4kcsgr,
END OF waRm.
DATA itab_waRm LIKE STANDARD TABLE OF waRm.
DATA: matType LIKE mara-mtart,
plndate(3) TYPE C, "marc-plifz.
stdprice(12) TYPE C, "mbew-stprs
priceunt(5) TYPE C, "mbew-peinh
ok_code LIKE sy-ucomm.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETER werks LIKE marc-werks DEFAULT '1000' OBLIGATORY.
PARAMETER lgort LIKE mard-lgort OBLIGATORY.
PARAMETER maktx LIKE makt-maktx OBLIGATORY.
PARAMETER meins LIKE mara-meins OBLIGATORY.
PARAMETER matkl LIKE mara-matkl OBLIGATORY.
PARAMETER extwg LIKE mara-extwg OBLIGATORY.
PARAMETER ekwsl LIKE mara-ekwsl OBLIGATORY.
PARAMETER j_3apgnr LIKE mara-j_3apgnr OBLIGATORY.
PARAMETER peinh LIKE mbew-peinh DEFAULT '1' OBLIGATORY.
PARAMETER stprs LIKE mbew-stprs OBLIGATORY.
PARAMETER losgr LIKE marc-losgr DEFAULT '1000' OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS yfab RADIOBUTTON GROUP GR1 USER-COMMAND ACT DEFAULT 'X'.
PARAMETERS yacc RADIOBUTTON GROUP GR1.
PARAMETERS ypak RADIOBUTTON GROUP GR1.
SELECTION-SCREEN END OF BLOCK b1.
*SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
**
*SELECTION-SCREEN END OF BLOCK b2 .
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
PARAMETER zeinr LIKE mara-zeinr.
PARAMETER j_3afcc LIKE mara-j_3afcc MODIF ID A.
PARAMETER j_3acol LIKE mara-j_3acol MODIF ID A.
PARAMETER plifz LIKE marc-plifz .
PARAMETER j_4kcsgr LIKE mara-j_4kcsgr .
PARAMETER land1 LIKE t005-land1.
SELECTION-SCREEN END OF BLOCK b3 .
AT SELECTION-SCREEN.
ok_code = sy-ucomm.
AT SELECTION-SCREEN OUTPUT.
LOOP AT screen.
IF yfab = 'X'.
IF screen-group1 = 'B'.
screen-active = 0.
ENDIF.
ELSEIF yacc = 'X' OR ypak = 'X'.
IF screen-group1 = 'A'.
screen-active = 0.
ENDIF.
ENDIF.
MODIFY screen.
ENDLOOP.
START-OF-SELECTION.
CLEAR: matType, plndate, stdprice, priceunt.
IF yfab = 'X'.
matType = 'ZFAB'.
ELSEIF yacc = 'X'.
matType = 'ZACC'.
ELSEIF ypak = 'X'.
matType = 'ZPAK'.
ENDIF.
plndate = plifz.
stdprice = stprs.
priceunt = peinh.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_OKCODE' '=ENTR'.
perform bdc_field using 'RMMG1-MBRSH' 'F'.
perform bdc_field using 'RMMG1-MTART' matType.
IF matType = 'ZFAB'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(03)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(08)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(09)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(10)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(11)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(12)' 'X'.
PERFORM bdc_field USING 'BDC_OKCODE' '=P+'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(03)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(04)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)' 'X'.
perform bdc_field using 'BDC_OKCODE' '=ENTR'.
ELSEIF matType = 'ZACC' OR matType = 'ZPAK'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(02)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(03)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(05)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(08)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(09)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(10)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(11)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(12)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(15)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(16)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(17)' 'X'.
perform bdc_field using 'MSICHTAUSW-KZSEL(18)' 'X'.
PERFORM bdc_field USING 'BDC_OKCODE' '=P+'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)' 'X'.
perform bdc_field using 'BDC_OKCODE' '=ENTR'.
ENDIF.
* Organizational Level
perform bdc_dynpro using 'SAPLMGMM' '0080'.
perform bdc_field using 'BDC_OKCODE' '=ENTR'.
perform bdc_field using 'RMMG1-WERKS' werks.
perform bdc_field using 'RMMG1-LGORT' lgort.
* Basic Data 1
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_field using 'MARA-MEINS' meins.
perform bdc_field using 'MARA-MATKL' matkl.
perform bdc_field using 'MARA-EXTWG' extwg.
* Basic Data 2
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_field using 'MARA-ZEINR' zeinr.
perform bdc_field using 'MARA-J_3AFCC' j_3afcc.
* AFS Basic Data
perform bdc_dynpro using 'SAPLMGMM' '4030'.
perform bdc_field using 'BDC_OKCODE' '=AFSSTAT'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_field using 'MARA-J_3APGNR' j_3apgnr.
perform bdc_field using 'MARA-J_3ACOL' j_3acol.
IF j_3apgnr <> 'NO GRID'.
perform bdc_field using 'MARA-J_3ANOGRID' ''.
ELSE.
perform bdc_field using 'MARA-J_3ANOGRID' 'X'.
ENDIF.
perform bdc_field using 'MARA-J_4KCSGR' j_4kcsgr.
perform bdc_field using 'MARA-J_4KCOVSA' j_4kcsgr.
perform bdc_field using 'MARA-MEINS' meins.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE' '=YES'.
perform bdc_dynpro using 'SAPLMGMM' '4030'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
IF j_3apgnr <> 'NO GRID'.
perform bdc_field using 'MARA-J_3ANOGRID' ''.
ELSE.
perform bdc_field using 'MARA-J_3ANOGRID' 'X'.
ENDIF.
perform bdc_field using 'MARA-MEINS' meins.
perform bdc_dynpro using 'SAPLMGMM' '4030'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
* Purchasing
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_field using 'MARA-MEINS' meins.
perform bdc_field using 'MARA-MATKL' matkl.
perform bdc_field using 'MARA-EKWSL' '2'.
* MRP 1
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_field using 'MARA-MEINS' meins.
perform bdc_field using 'MARC-DISMM' 'PD'.
perform bdc_field using 'MARC-DISPO' '100'.
perform bdc_field using 'MARC-DISLS' 'EX'.
* MRP 2
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_field using 'MARC-SOBSL' '80'.
perform bdc_field using 'MARC-PLIFZ' plndate.
perform bdc_field using 'MARC-FHORI' '000'.
* MRP 3
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_field using 'MARC-PERKZ' 'M'.
perform bdc_field using 'MARC-MTVFP' '02'.
* MRP 4
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
* AFS MRP
perform bdc_dynpro using 'SAPLMGMM' '4030'.
perform bdc_field using 'BDC_OKCODE' '=AFSSTATC'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_field using 'MARC-J_3ADISPKZ' 'N'.
perform bdc_field using 'MARC-J_3ACHINT' 'X'.
perform bdc_field using 'MARC-XCHPF' 'X'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE' '=YES'.
perform bdc_dynpro using 'SAPLMGMM' '4030'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_field using 'MARC-J_3ADISPKZ' 'N'.
perform bdc_field using 'MARC-XCHPF' 'X'.
perform bdc_dynpro using 'SAPLMGMM' '4030'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_dynpro using 'SAPLMGMM' '4030'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_dynpro using 'SAPLMGMM' '4030'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
* Accounting 1
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_field using 'MARA-MEINS' meins.
perform bdc_field using 'MBEW-PEINH' priceunt.
perform bdc_field using 'MBEW-STPRS' stdprice.
* Accounting 2
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
* AFS Valuation
perform bdc_dynpro using 'SAPLMGMM' '4030'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_field using 'MARC-J_4KDEFSC' land1.
* Costing 1
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_field using 'MARA-MEINS' meins.
perform bdc_field using 'MARC-NCOST' 'X'.
perform bdc_field using 'MBEW-HKMAT' 'X'.
perform bdc_field using 'MARC-PRCTR' matkl.
perform bdc_field using 'MARC-LOSGR' '1000'.
* Costing 2
perform bdc_dynpro using 'SAPLMGMM' '4000'.
perform bdc_field using 'BDC_OKCODE' '/00'.
perform bdc_field using 'MAKT-MAKTX' maktx.
perform bdc_field using 'MBEW-PEINH' priceunt.
perform bdc_field using 'MBEW-STPRS' stdprice.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE' '=YES'.
CALL TRANSACTION 'MM01' USING bdcdata MODE 'E' UPDATE 'S'.
REFRESH bdcdata.
CLEAR: lgort, maktx, meins, matkl, extwg, ekwsl, j_3apgnr,
plifz, stprs, j_4kcsgr, land1.
*---------------------------------------------------------------------*
* FORM BDC_DYNPRO *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> PROGRAM *
* --> DYNPRO *
*---------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. " BDC_DYNPRO
*---------------------------------------------------------------------*
* FORM BDC_FIELD *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> FNAM *
* --> FVAL *
*---------------------------------------------------------------------*
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM.
Friday, November 23, 2007
ABAP Interactive reporting + BDC (RM Creation)
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2007
(952)
-
▼
November
(716)
- SAP Paper Documents
- SAP Repository
- SAP R/3 Implementation and Maintenance Tips
- ABAP/4 programming language overview
- The interactive eLearning system for ABAP™
- Helpful System Administration ABAPS
- free download abap programmin pdf book
- examples of real time objects in sap abap(1)
- examples of real time objects in sap abap
- work flow example2
- Workflow tips
- Miscellaneous sap abap faq
- BDC , LSMW, Conversions faq in abap
- Sap Scripts & Smart forms faqs in abap
- performance tuning in abap faqs
- Real Time BDC & LSMW faqs
- Real Time ABAP Internal Tables faqs
- Real Time ABAP Reports faqs
- Real Time questions ..in sap ABAP
- SAP ABAP FAQ (Technical)
- ABAP and Unicode
- ABAP and JavaScript
- ABAP Objects
- ABAP Database Access
- Running ABAP Programs
- ABAP User Dialogs
- The ABAP Programming Language
- Creating and Changing ABAP Programs
- Overview of the Components of Application Programs
- Introduction to ABAP
- ABAP Programming Documentation
- FREE DOWNLOAD ALE, EDI & IDOCS
- Conversion of IDOCs to XML.pdf
- FREE DOWNLOAD IDOC Interface Technology
- FREE DOWNLOAD EDI, IDOC Interface
- FREE DOWNLOAD IDOC BOOK
- FREE DOWNLOAD LSMW - Idoc Inbound Processing
- FREE DOWNLOAD SAP ABAP Idoc Interface
- FREE DOWNLOAD Java for SAP
- FREE DOWNLOAD Java for ABAP Programmers
- FREE DOWNLOAD Java and BAPI technology for EP
- free download Building Web Services with Java and ...
- free download Enable SAP with the power of Javascript
- FREE DOWNLOAD ABAP Training Simulator
- FREE DOWNLOAD SAP Accounting Training Simulators
- free download SAPScripts Made Easy
- CONDENSE
- CONSTANTS
- ABAP Quick Viewer
- sap abap XXL (EXtended Export of Lists)
- Some ABAP/4 Query header line variable
- Understanding SAP Query
- ABAP/4 Query
- ABAP/4 Query Hints and Tips
- SAP Website Links Exchange for ABAP, Basis or Cons...
- sap abap Program for Generate IDoc
- sap abap program for Reads an existing Idoc and di...
- List of ABAP Function modules
- sap abap FTP programming
- sap abap program for Issuing an Unix Command from ...
- sap abap program for RFC call to get Server List
- sap abap program for A SAP Pop-out Calculator
- sap ABAP program for Timers and Auto-refresh
- sap abap program for WS_EXECUTE to called External...
- sap abap programming Execute DOS Command from ABAP...
- To execute a dos command from ABAP
- sap abap program for Make your SAPGUI Disappear an...
- sap abap program for Using Function Modules F4_FIL...
- abp program for How to Restrict the Select Options
- sap abap program for Take Values from Selection-Sc...
- sap abap program for Change Text Into Password
- sap abap program for Function Module for Encryptio...
- sap abap program for FM VRM_SET_VALUE To List Box
- sap abap program for Value Request For Parameter
- sap abap program for Pop a Message to specific SAP...
- ABAP Pop-out box for user confirmation
- sap ABAP program for POP-UP Window
- sap abap program Sample XML Source Code For SAP
- sap abap XML file to word document through SAP
- sap abap program for How to Write Web Reports in SAP
- sap abap conversion Program to Test Line Selection...
- sap abap program for String Handling in ABAP - Rem...
- sap abap program for Split String into two parts a...
- sap abap conversion Program For Printing Prime Number
- sap abap program for How can I get Ascii value of ...
- sap abap program for Figure to Words for India but...
- sap abap conversion program for Print Number Value...
- sap abap conversion program for Insert a special T...
- sap abap program for String Handling in ABAP - Rem...
- sap abap program for Split String into two parts a...
- sap abap conversion Program For Printing Prime Number
- sap abap program for How can I get Ascii value of ...
- sap abap program for Figure to Words for India but...
- sap abap conversion program for Print Number Value...
- sap abap conversion program for Insert a special T...
- sap abap program for Convert SAP Spool List to HTML
- sap program for Convert Month to Word in ABAP
- ABAP function to convert Number to Words
- sap abap program for How to Create Tree Control
- sap abap A sample Tree Programming
-
▼
November
(716)
No comments:
Post a Comment