Skip to Content

How to get variant data from standard report to custom report

Hi Team,

I need to get variant data from standard report to custom report, so am using FM-RS_PROGRAM_POPUP_VARIANT & am getting the required values but this FM is not released. So my client suggested me not to use UNRELEASED FM.

So please help me, is there any other FM/method/class is available to get variant data based on report & variant name.

Thanks,

Shabari

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Nov 03, 2018 at 06:24 AM

    You can write like below sample code for data from standard report to custom report .

    DATA: SELTAB TYPE TABLE OF RSPARAMS,
    SELTAB_WA LIKE LINE OF SELTAB.

    SELTAB_WA-SELNAME = 'MATNR'.
    SELTAB_WA-KIND = 'S'.
    SELTAB_WA-SIGN = 'I'.
    SELTAB_WA-OPTION = 'EQ'.
    SELTAB_WA-LOW = WA_MIS-HMATNR.
    APPEND SELTAB_WA TO SELTAB.

    SELTAB_WA-SELNAME = 'MATNR'.
    SELTAB_WA-KIND = 'S'.
    SELTAB_WA-SIGN = 'I'.
    SELTAB_WA-OPTION = 'EQ'.
    SELTAB_WA-LOW = WA_MIS-SMATNR.
    APPEND SELTAB_WA TO SELTAB.
    CLEAR : SELTAB_WA.

    LOOP AT P_WERKS . " Added by Jafar abbas NBS Oct-2018
    SELTAB_WA-SELNAME = 'WERKS'.
    SELTAB_WA-KIND = 'S'.
    SELTAB_WA-SIGN = 'I'.
    SELTAB_WA-OPTION = 'EQ'.
    SELTAB_WA-LOW = P_WERKS-LOW.
    APPEND SELTAB_WA TO SELTAB.

    SELTAB_WA-SELNAME = 'DATUM'.
    SELTAB_WA-KIND = 'S'.
    SELTAB_WA-SIGN = 'I'.
    SELTAB_WA-OPTION = 'EQ'.
    SELTAB_WA-LOW = DATE-HIGH.

    APPEND SELTAB_WA TO SELTAB.

    SUBMIT RM07MLBD WITH SELECTION-TABLE SELTAB EXPORTING LIST TO MEMORY AND RETURN.
    REFRESH : ITAB_LIST,VLIST.
    CLEAR : ITAB_LIST , VLIST.
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    LISTOBJECT = ITAB_LIST
    EXCEPTIONS
    NOT_FOUND = 4
    OTHERS = 8.

    CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
    LIST_INDEX = -1
    * WITH_LINE_BREAK = ' '
    * IMPORTING
    * LIST_STRING_ASCII =
    * LIST_DYN_ASCII =
    TABLES
    LISTASCI = VLIST
    LISTOBJECT = ITAB_LIST
    EXCEPTIONS
    EMPTY_LIST = 1
    LIST_INDEX_INVALID = 2
    OTHERS = 3

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 29, 2018 at 08:29 AM

    Hi Shabari,

    You can use the below FM which will give you the list of variants, you can use the same for your value help request in report to show the F4 help.

    RS_VARIANT_CATALOG

    Best Regards,
    Mahesh

    Add comment
    10|10000 characters needed characters exceeded