Skip to Content

Can F4IF_INT_TABLE_VALUE_REQUEST FM return a value in a global variable?

Hi everybody,

I need to use F4IF_INT_TABLE_VALUE_REQUEST FM because I have to let users select an specific option before choosing another value. The point is that I need to save in a program global variable what the user selects, and decide something with it in the program.

Is it possible that F4IF_INT_TABLE_VALUE_REQUEST FM returns the value in a sinple variable or it has to be paramter?

I look in a lot of previous threads but I didn't find anything, and I don't know if it's possible.

Thanks and kind regards,

MMP.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 17, 2008 at 06:24 PM

    Hi,

    Sure you can. All you need to do is to store what the function returns in your global variable. It don't need to be returned back to screen field.

    DATA: BEGIN OF VALUES OCCURS 0,
             CARRID TYPE SPFLI-CARRID,
             CONNID TYPE SPFLI-CONNID,
           END OF VALUES.
    
    DATA: VALUES_TAB TYPE TABLE OF VALUES,
              G_VALUE TYPE SPFLI-CONNID.  "global variable to store what is returned
    
    "in PAI first populate your table
      SELECT  CARRID CONNID
        FROM  SPFLI
        INTO  CORRESPONDING FIELDS OF TABLE VALUES_TAB
        UP TO 10 ROWS.
    
    "then call the function but don't return the value to screen field
    "If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the useru2019s selection is
    "returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the
    "selection is returned into the table instead.
    
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                RETFIELD         = 'CONNID'
                VALUE_ORG        = 'S'
           TABLES
                VALUE_TAB        = VALUES_TAB
                RETURN_TAB      = RETURN_TAB.
    
    "now simply read first row of return tab and store the value returned there in some global var
    READ RETURN_TAB INDEX 1.
    MOVE RETURN_TAB-FIELDVAL TO G_VALUE.
    

    Regards

    Marcin

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 18, 2008 at 02:34 AM

    Thank you very much for the answer. My problem was solved with your suggestion.

    Kind regards,

    M.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.