Application Development and Automation 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: 
Read only

Call program using submit with variant that changing value

Former Member
0 Likes
2,696

Hi All,

I need to call a report with variant and abstract the data back to my current program.

so far,

i use following method

SUBMIT RFITEMAR USING SELECTION-SET 'XXX'
       EXPORTING LIST TO MEMORY
       AND RETURN.
 
DATA list_tab TYPE TABLE OF abaplist.
 
CALL FUNCTION 'LIST_FROM_MEMORY'
  TABLES
    listobject = list_tab
  EXCEPTIONS
    not_found  = 1
    OTHERS     = 2.
 
  DATA: L_ABAPLIST LIKE ABAPLIST OCCURS 0.
  
  DATA: BEGIN OF L_ASCITAB OCCURS 0,  
            LINE(2048),
          END OF L_ASCITAB.
 
 
  CALL FUNCTION 'LIST_TO_ASCI'
       EXPORTING
            LIST_INDEX         = -1
       TABLES
            LISTASCI           = L_ASCITAB
            LISTOBJECT         = list_tab
       EXCEPTIONS
            EMPTY_LIST         = 1
            LIST_INDEX_INVALID = 2
            OTHERS             = 3.

However, the problem is that i need to get some value from variant 'XXX' and keep changing it.

I have try function module "RS_VARIANT_VALUES_TECH_DATA" to get the variant details.

But, it just doesn't get me back all the details of the variants.

Are there any way i could read the variants in detail? i even try to read LRAW data from table vari. but there are no function module to convert the LRAW to either char or STRING.

Thanks.

Edited by: simplekx on Jun 20, 2011 4:43 PM

2 REPLIES 2
Read only

Former Member
0 Likes
1,189

Try function "RS_VARIANT_CONTENTS", it returns all details and parameters from the variants.

Read only

Former Member
0 Likes
1,189

You can use the FM "RS_CHANGE_CREATED_VARIANT" to change the variant values for already created variant and the FM "RS_VARIANT_CONTENTS" to get the variant values. Instead of changing the variant values and then passing to the Submit, you can directly pass the values to the Submit through..WITH SELECTION-TABLE seltab or ... WITH p IN sel variant of the Submit.