Application Development 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: 

Need some help on POPUP_GET_VALUES_USER_HELP function module

Former Member
0 Kudos

Hi Experts,

This is in reference to mentioned FM in subject line i.e. POPUP_GET_VALUES_USER_HELP. Please find the below code .

DATA : LV_POSI TYPE STRING,
               LV_WBS_ELMT(132) TYPE C,
               LV_PROJ_DEF(132) TYPE C.
*             LV_APRV_DATE(132) TYPE C.
        DATA :  LWA_FLDS LIKE LINE OF GT_FIELDS.
        CLEAR: GT_FIELDS, G_TC1_BOQ_WA, LV_WBS_ELMT,LV_PROJ_DEF."LV_APRV_DATE.
        REFRESH GT_FIELDS.

        IF OK_CODE = 'HIST'.

          GT_FIELDS-TABNAME = 'ZPS_BOQ_HIST'.
          GT_FIELDS-FIELDNAME = 'PROJ_DEF'.
          GT_FIELDS-FIELD_OBL = 'X'.
          GT_FIELDS-NOVALUEHLP = ''.
          APPEND GT_FIELDS.

          GT_FIELDS-TABNAME = 'ZPS_BOQ_HIST'.
          GT_FIELDS-FIELDNAME = 'APRV_DATE'.
          GT_FIELDS-FIELD_OBL = 'X'.
          GT_FIELDS-NOVALUEHLP = ''.
          APPEND GT_FIELDS.
          CALL FUNCTION 'POPUP_GET_VALUES_USER_HELP'
            EXPORTING
              POPUP_TITLE     = 'Search'
              START_COLUMN    = '5'
              START_ROW       = '5'
            TABLES
              FIELDS          = GT_FIELDS
            EXCEPTIONS
              ERROR_IN_FIELDS = 1
              OTHERS          = 2.
          IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.

I have placed two fields on the pop up window, Project definition and Approval date (These field values are maintained in my custom table) Now my requirement is if user selects proj definition then when user press f4 help for Approval date, he should get only those approval dates on which Project was approved.

Please let me know if you need any further relevant info.

Cheers

VJ

5 REPLIES 5

Former Member
0 Kudos

Hi!

Try to create you own F4 logic in custom procedure:


 CALL FUNCTION 'POPUP_GET_VALUES_USER_HELP'
       EXPORTING POPUP_TITLE     = POPUP_TITLE
                 F4_PROGRAMNAME  = 'RSSPO440'
                 F4_FORMNAME     = 'EXAMPLE_1_F4'
       IMPORTING RETURNCODE      = RETURNCODE
       TABLES    FIELDS          = FIELDS.



FORM EXAMPLE_1_F4 USING     TABNAME FIELDNAME DISPLAY
                  CHANGING  RETURNCODE VALUE.
* write F4 logic here 
*CASE fieldname.
*    WHEN ....

*    WHEN ....

*  ENDCASE.
ENDFORM.

look at RSSPO440 report at where-used list to find examples.

BR!

0 Kudos

Hi !!!

Can you please bit more clear on the coding part of the subroutine since I am confused how to proceed . Actually my requirement is, for project definition, whenever user presses f4 help he can see all the project definitions which are there in my custom table ZPS_HISTORY. Now whenever he selects some project definition, he could only see approval dates only for that project definition. The problem here is how to capture the project definition value which he has selected on pop up window. Can you please help me out on this part.

Cheers

VJ

0 Kudos

hI!

I mean coding like this in :

IF fieldname = project definition

select value by 'F4IF_FIELD_VALUE_REQUEST'

save it in global variable

...

IF fieldname = 'DATE'.

select dates with saved project definition and show values with HELP_VALUES_GET_WITH_TABLE

but it no good solution.

Another way - create seach help with import export parameters and assign to tables fields.

Look at example:


REPORT  z_popup                               .
DATA: BEGIN OF fields OCCURS 1.
        INCLUDE STRUCTURE sval.
DATA: END OF fields.

CLEAR fields.
MOVE 'T001L' TO fields-tabname.
MOVE 'WERKS' TO fields-fieldname.
APPEND fields.
CLEAR fields.
MOVE 'T001L' TO fields-tabname.
MOVE 'LGORT' TO fields-fieldname.
APPEND fields.

CALL FUNCTION 'POPUP_GET_VALUES_USER_HELP'
  EXPORTING
    popup_title = 'test'
  TABLES
    fields      = fields.

it works as you need it.

MrWhan
Participant
0 Kudos

I've done something with a similar function that allows me to use the values i choose that may help.


  plfields-tabname    = 'T591S'.
  plfields-fieldname  = 'SUBTY'.
  plfields-selectflag = 'X'.
  APPEND plfields. CLEAR plfields.

  plfields-tabname    = 'T591S'.
  plfields-fieldname  = 'STEXT'.
  plfields-selectflag = ' '.
  APPEND plfields. CLEAR plfields.

  SELECT * FROM t591s
    WHERE sprsl = sy-langu AND
          infty = '9090'.
    MOVE t591s-subty TO valuetab-line.
    APPEND valuetab.
    MOVE t591s-stext TO valuetab-line.
    APPEND valuetab.
  ENDSELECT.

  CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'
    EXPORTING
      title_in_values_list = 'List header line'
      titel                = 'Pick a Call Type'
    IMPORTING
      select_value         = p_funkt-high
    TABLES
      fields               = plfields
      valuetab             = valuetab.

Former Member
0 Kudos

Solved.