Age: 160 Joined: 04 Oct 2007 Posts: 1218 Location: Санкт-Петербург
Posted: Thu Sep 02, 2010 3:02 pm Post subject: Batch-input for MMRV
Code:
REPORT zbdcmmrv.
TABLES: marv.
* Batch Input Name
PARAMETERS p-btchsn(12) DEFAULT 'MMRVCHANGE'.
* Company Code
PARAMETERS p-bukrs LIKE marv-bukrs.
* Auto / Manual run the Batch Input Program
PARAMETERS p-run AS CHECKBOX DEFAULT 'X'.
* INTERNAL TABLE FOR DATA
DATA: BEGIN OF ultab OCCURS 50,
bukrs LIKE marv-bukrs, "Company Code
END OF ultab.
* INTERNAL TABLE FOR BATCH INPUT DATA
DATA: BEGIN OF iputtab OCCURS 50.
INCLUDE STRUCTURE bdcdata.
DATA: END OF iputtab.
* INTERNAL TABLE FOR BATCH INPUT ERROR MESSAGE.
DATA: BEGIN OF messtab OCCURS 50.
INCLUDE STRUCTURE bdcmsgcoll.
DATA: END OF messtab.
DATA: c_taxkm LIKE mg03steuer-taxkm VALUE '1',
w-line-no TYPE i.
REFRESH ultab.
SELECT * FROM marv WHERE bukrs = p-bukrs.
ultab-bukrs = marv-bukrs.
APPEND ultab.
ENDSELECT.
* CHECK WHETHER TABLE IS EMPTY
IF ultab[] IS INITIAL.
WRITE: / 'TABLE EMPTY'.
ENDIF.
* Specify that we are now done with this screen (Save it with F11)
CLEAR iputtab.
iputtab-fnam = 'BDC_OKCODE'.
iputtab-fval = '/11'.
APPEND iputtab.
ENDFORM. "SCREEN2
***********************************************************************
* FORM : CLOSE-SESS *
* DESCRIPTION : CLOSE THE SESSION *
***********************************************************************
FORM close-sess.
* closing the session.
IF p-run = 'X'.
* Auto run the Batch Input Program
CALL TRANSACTION 'MMRV'
USING iputtab
MODE 'E'
UPDATE 'S'
MESSAGES INTO messtab.
ELSE.
* Maual run the Batch Input Program
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = 'MMRV'
TABLES
dynprotab = iputtab.
ENDIF.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.