ABAP Program for Submitting report with selection table

Sample ABAP Program for learning how to Submit report with selection table

REPORT submit_with_selection_table.
TABLES QMSM.
* Work area for internal table IQMSM
DATA: BEGIN OF WQMSM,
QMNUM LIKE QMSM-QMNUM,
MNGRP LIKE QMSM-MNGRP,
MNCOD LIKE QMSM-MNCOD,
ZZSTAT LIKE QMSM-ZZSTAT,
END OF WQMSM.

* WORK Area for internal table iseltab.
DATA: WSELTAB LIKE RSPARAMS.
*----------------------------------------------------------------------*
* Internal tables
*----------------------------------------------------------------------*
* selection table to pass to RIQMEL30
DATA: ISELTAB LIKE TABLE OF WSELTAB.
* Table of notification numbers selected - will be passed to riqmel30
DATA: IQMSM LIKE TABLE OF WQMSM.
*----------------------------------------------------------------------*
START-OF-SELECTION.
*----------------------------------------------------------------------*
REFRESH IQMSM.
SELECT QMNUM MNGRP MNCOD ZZSTAT
FROM QMSM INTO CORRESPONDING FIELDS OF TABLE IQMSM
WHERE MNGRP = 'ACTION'
AND MNCOD = 'CALL'
and ( zzqmart = 'ZE' or zzqmart = 'ZI' )
AND ZZSTAT = ' '.

* create selection table entries for field QMART

WSELTAB-SELNAME = 'QMART'.
WSELTAB-KIND = 'S'.
WSELTAB-SIGN = 'I'.
WSELTAB-OPTION = 'EQ'.
WSELTAB-LOW = 'ZE'.
APPEND WSELTAB TO ISELTAB.
WSELTAB-LOW = 'ZI'.
APPEND WSELTAB TO ISELTAB.

* Create selection table entries for QMNUM

CLEAR WSELTAB.
WSELTAB-SELNAME = 'QMNUM'.
WSELTAB-KIND = 'S'.
WSELTAB-SIGN = 'I'.
WSELTAB-OPTION = 'EQ'.
LOOP AT IQMSM INTO WQMSM.
WSELTAB-LOW = WQMSM-QMNUM.
APPEND WSELTAB TO ISELTAB.
ENDLOOP
*
* SUBMIT program with parameters passed in table ISELTAB
* Other parameters passed explicitly

SUBMIT RIQMEL30 WITH SELECTION-TABLE ISELTAB
WITH MNGRP = 'ACTION'
WITH MNCOD = 'CALL'
WITH DATUV = '00000000'
WITH DATUB = '99991231'
WITH STAI1 = 'TSRL'.

Most readed SAP Tutorials

Latest Added SAP documents

Custom Search
ABAP Tutorials ABAP Syntax BAPI SAP Jobs SAP Glossary SAP Netweaver SAP XI SAP Download SAP Interview questions

Complete SAP Study materials | SAP JOBS | PDF Tutorials   List of SAP Companies India

Google-Translate-Chinese (Simplified) BETA Google-Translate-English to French Google-Translate-English to German Google-Translate-English to Italian Google-Translate-English to Japanese BETA Google-Translate-English to Korean BETA Google-Translate-English to Russian BETA Google-Translate-English to Spanish

All of the product names here are trademarks of their respective companies. The site sapbrainsonline.com no way affiliated with SAP AG. Use information on this site at your own risk. Information furnished in the site is collected from various sites and posts from users. This site does not host any files on its server. If any compliants about the posts please contact us at sapbrain.support@gmail.com

Sitemap
web counter