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

Problems with CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

Former Member
0 Likes
1,780

Hello

I have tried doing a dropdown box. My main problem is that in PAI I do a select and in POV I call a module CREATE_DROPDOWN_BOX but IT_SBOOK is empty.

Thanks a lot in advance.

PROCESS BEFORE OUTPUT.
  MODULE STATUS_0100.
  MODULE CLEAR_OK.

PROCESS AFTER INPUT.
  MODULE USER_COMMAND_0100.
  MODULE LEER_DATOS.    
"select carrid connid from sbook into corresponding  fields of table it_sbook...

PROCESS ON VALUE-REQUEST.

 FIELD IT_SBOOK-CARRID MODULE CREATE_DROPDOWN_BOX.
 FIELD IT_SBOOK-CONNID MODULE CREATE_DROPDOWN_BOX.

MODULE CREATE_DROPDOWN_BOX INPUT.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      RETFIELD        = 'CARRID'
      VALUE_ORG       = 'S'
      DYNPNR          = '0100'
    TABLES
      VALUE_TAB       = IT_SBOOK
    EXCEPTIONS
      PARAMETER_ERROR = 1
      NO_VALUES_FOUND = 2
      OTHERS          = 3.
  IF SY-SUBRC <> 0.
    MESSAGE E028(ZANA).
  ENDIF.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      RETFIELD        = 'CONNID'
      VALUE_ORG       = 'S'
      DYNPNR          = '0100'

    TABLES
      VALUE_TAB       = IT_SBOOK
    EXCEPTIONS
      PARAMETER_ERROR = 1
      NO_VALUES_FOUND = 2
      OTHERS          = 3.
  IF SY-SUBRC <> 0.
    MESSAGE E028(ZANA).
    ENDIF.
ENDMODULE.                    "create_dropdown_box INPUT

18 REPLIES 18
Read only

Former Member
0 Likes
1,665

In val_org parameter give 'C' instaed of "S'.C for column.Try this....

Read only

Former Member
0 Likes
1,665

Thanks I have tried change 's' to 'c' and it doesn't work

Read only

Former Member
0 Likes
1,665

hi,

u have to fill it_sbook. check is it having data?

Read only

Former Member
0 Likes
1,665

The user should at least hit the Enter key before hitting the F4 key so that the PAI gets triggered which ensures that the internal table IT_SBOOK gets populated. Why don't u populate the internal table IT_SBOOK in the module CREATE_DROPDOWN_BOX itself?

Read only

0 Likes
1,665

Answer:The user should at least hit the Enter key before hitting the F4 key so that the PAI gets triggered which ensures that the internal table IT_SBOOK gets populated. Why don't u populate the internal table IT_SBOOK in the module CREATE_DROPDOWN_BOX itself?

Ana: Because de Module Create_dropdown_box is called using it_sbook so I need that the table is full .

PROCESS ON VALUE-REQUEST.

 FIELD <b>IT_SBOOK-CARRID</b> MODULE CREATE_DROPDOWN_BOX.

Read only

0 Likes
1,665

hi Ana,

Did u try what I suggested?

Just try that, you don't require user to press enter.

Regards

Nishant

Read only

0 Likes
1,665

There is no such restriction, viz., the internal table IT_SBOOK should be filled with data, all u need to provide in the FIELD statement is the name of the screen field and the corresponding MODULE that populates the F4 help. U can do a NOT INITIAL check before populating the internal table IT_SBOOK in both PAI and POV modules.

Read only

Former Member
0 Likes
1,665

HI,

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'CARRID'

VALUE_ORG = 'S'

DYNPPROG = sy-repid

DYNPNR = '0100'

<b> DYNPROFIELD = '<field name in screen>'</b> "to which u want f4 help in CAPS

TABLES

VALUE_TAB = IT_SBOOK

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

rgds,

bharat.

Read only

0 Likes
1,665

DYNPROFIELD = '<field name in screen>' "to which u want f4 help in CAPS

Hello I put

DYNPROFIELD     =  'CAR'

I don't know if I understand your words . 'CAR' is the name that I put in the function code in Layout. Is it ok??

Thanks

Read only

Former Member
0 Likes
1,665

PROCESS BEFORE OUTPUT.
  MODULE STATUS_0100.
  MODULE CLEAR_OK.
* Place this select query in a module in PBO. 
"select carrid connid from sbook into corresponding  fields of table it_sbook...



PROCESS AFTER INPUT.
  MODULE USER_COMMAND_0100.
  MODULE LEER_DATOS.    

Why the above code ?

When you run dialog progam first PBO is executed.

Then user does action which is some kind of input.

This triggers PAI.

When you have declared POV, it get's executed when F4 is pressed. This is not equal to user input so PAI is not triggered hence when you press F4 the help is not working.

In the above code, Select query will get executed when PBO is executed so it_sbook will always fill and when you press f4 you'll see the help.

I am sure this will work.

Please mark this thread as answered once your query is resolved

Regards

Nishant

Read only

0 Likes
1,665

It's a good idea put the select (Module leer_datos) in PBO, but it doesn't work too because I think that my problem is PROCESS ON VALUE-REQUEST I do something that is not correct. Because I have deleted PROCESS ON VALUE-REQUEST and the program runs ok.

But now I only have the help(F4) in box CARRID and the field CONNID don't give the help.

PROCESS BEFORE OUTPUT.
  MODULE STATUS_0100.
  MODULE CLEAR_OK.
  MODULE LEER_DATOS.

PROCESS AFTER INPUT.
  MODULE USER_COMMAND_0100.

PROCESS ON VALUE-REQUEST. "problems
* FIELD IT_SBOOK-CARRID MODULE CREATE_DROPDOWN_BOX.
* FIELD IT_SBOOK-CONNID MODULE CREATE_DROPDOWN_BOX.

____________________my_program

Main________________

INCLUDE MZ05BC410_SOLUTION_TOP.                      " global Data
INCLUDE MZ05BC410_SOLUTION_STATUS_0O01.              " PBO-Modules
INCLUDE MZ05BC410_SOLUTION_USER_COMI01.              " PAI-Modules

top___________________

REPORT  ZDROPDOWN_LISTBOX MESSAGE-ID ZANA.
TABLES:SBOOK.

TYPES: BEGIN OF S_SBOOK,
      CARRID TYPE SBOOK-CARRID,
      CONNID TYPE SBOOK-CONNID,
      CUSTTYPE TYPE SBOOK-CUSTTYPE,
      END OF S_SBOOK.

DATA: IT_SBOOK TYPE STANDARD TABLE OF S_SBOOK WITH HEADER LINE,
      OK_CODE TYPE SY-UCOMM.

PBO_____________________________

PROCESS BEFORE OUTPUT.
  MODULE STATUS_0100.
  MODULE CLEAR_OK.
  MODULE LEER_DATOS.

PAI___________________________________

PROCESS AFTER INPUT.
  MODULE USER_COMMAND_0100.

POV__________________________________

PROCESS ON VALUE-REQUEST.

FIELD IT_SBOOK-CARRID MODULE CREATE_DROPDOWN_BOX.
FIELD IT_SBOOK-CONNID MODULE CREATE_DROPDOWN_BOX.

MODULE LEER_DATOS.__________________

SELECT SINGLE CARRID CONNID
                FROM SBOOK
                INTO CORRESPONDING FIELDS OF TABLE IT_SBOOK.

MODULE CREATE_DROPDOWN_BOX._______________________

MODULE CREATE_DROPDOWN_BOX INPUT.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      RETFIELD        = 'CARRID'
      VALUE_ORG       = 'S'
      DYNPNR          = '0100'
      DYNPROFIELD     = 'CAR'
      "(DYNPROFIELD) TYPE  HELP_INFO-DYNPROFLD DEFAULT SPACE
    TABLES
      VALUE_TAB       = IT_SBOOK
    EXCEPTIONS
      PARAMETER_ERROR = 1
      NO_VALUES_FOUND = 2
      OTHERS          = 3.
  IF SY-SUBRC <> 0.
    MESSAGE E028(ZANA).
  ENDIF.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

"same with connid

ENDMODULE.

Read only

0 Likes
1,665

Hi Ana,

It's simple .

In that function Module


 CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      RETFIELD        = 'CARRID'
      VALUE_ORG       = 'S'
      DYNPNR          = '0100'
      DYNPROFIELD     = 'CAR'  "<-- This is supposed to be
* the name of the Field on the screen. If you created a *field of of name wf_carrid then put that in CAPS .
    TABLES
      VALUE_TAB       = IT_SBOOK
    EXCEPTIONS
      PARAMETER_ERROR = 1
      NO_VALUES_FOUND = 2
      OTHERS          = 3.
  IF SY-SUBRC <> 0.
    MESSAGE E028(ZANA).
  ENDIF.

Do what I mentioned and your f4 will work

Regards

Nishant

Message was edited by:

Nishant Rustagi

Read only

0 Likes
1,665

I don't know if its a good programming practise to fetch data in the PBO event of the screen(need some expert opinion on this). Leaving that aside, ur problem can be solved by using different POV modules for 'CARRID' and 'CONNID' and don't pass any value to the field '<b>DYNPROFIELD'</b>

PROCESS ON VALUE-REQUEST.

FIELD IT_SBOOK-CARRID MODULE CREATE_DROPDOWN_BOX_CARRID.

FIELD IT_SBOOK-CONNID MODULE CREATE_DROPDOWN_BOX_CONNID.

MODULE CREATE_DROPDOWN_BOX_CARRID INPUT.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'CARRID'

VALUE_ORG = 'S'

DYNPNR = '0100'

TABLES

VALUE_TAB = IT_SBOOK

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

MESSAGE E028(ZANA).

ENDIF.

ENDMODULE.

MODULE CREATE_DROPDOWN_BOX_CONNID INPUT.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'CONNID'

VALUE_ORG = 'S'

DYNPNR = '0100'

TABLES

VALUE_TAB = IT_SBOOK

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

MESSAGE E028(ZANA).

ENDIF.

ENDMODULE.

Message was edited by:

Rajesh

Added ENDMODULE statement

Read only

0 Likes
1,665

Hi Ana,

Rajesh is right.

I just noticed.

You cannot have same module for both fields since the RETFIELD will send have 'CARRID' in both case and it will cause same value to be filled in both the cases.

Also Rajesh,

It's perfectly OK to put SELECT query in PBO since this is the requirement.

PBO is for Before Output and we need the table to be ready b4 output.

It would look highly illogical for any user to be told that please press enter only then Help works!!

Regards

Nishant

Read only

0 Likes
1,665

<b>It would look highly illogical for any user to be told that please press enter only then Help works!!</b>

Hi Nishant,

Nice to see ur comments. If u populate the internal table in POV module then the user need not to hit the Enter key.

Read only

0 Likes
1,665

DYNPROFIELD = 'CAR' "<-- This is supposed to be

  • the name of the Field on the screen. If you created a *field of of name wf_carrid then put that in CAPS .

Thanks Nishant Rustagi so 'CAR' is correct.

Read only

Former Member
0 Likes
1,665

Right !

We can do that, but in my own opinion I wouldn't like to put it in POV b'coz I don't want any selection to be done on user action.

Also, in a typical scenario when system is very slow, just pressing F4 will cause frustration to user as contrast of slow loading of program itself !

Let me know your view on this

Nishant

Read only

0 Likes
1,665

Well Nishant,

We need to consider many cases before jumping to any conclusions

If u r populating the internal table only to provide F4 help then I would prefer to populate it in POV itself for the simple reason that PBO gets executed every time the user invokes any action that triggers PAI

@Ana

u neednot to pass any value to the field 'DYNPROFIELD'. I don't have access to SAP, kindly check.