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

selection screen

Former Member
0 Likes
1,008

I have created a selection screen from where I am inputting two values sales organization and distribution channel.

I want these two values for F4 help of the third input which is Area.

PARAMETERS : p_vkorg TYPE VBAK-VKORG OBLIGATORY,

p_vtweg TYPE VBAK-VTWEG OBLIGATORY.

SELECT-OPTIONS: so_state FOR KNVH-KUNNR,

Now when I am writing the Select query the fields that I am entering on the selection screen are not getting fetched into their respective parameters.

 
SELECT KUNNR
    FROM KNVH
    INTO TABLE I_KNVH_KUNNR
   WHERE VKORG = P_VKORG " this is showing blank 
     AND VTWEG = P_VTWEG " this is showing blank
     AND HITYP = 'S'
     AND HZUOR = 04

What may be the reason? How can I make my query work?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
974
data: it_dynpfields TYPE STANDARD TABLE OF dynpread,
                   wa_dynpfields TYPE dynpread.

REFRESH it_dynpfields.
  CLEAR wa_dynpfields.
  wa_dynpfields-fieldname = 'P_VKORG'.
  APPEND wa_dynpfields TO it_dynpfields.

  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname               = '<Report Name>'
      dynumb               = '1000'
    TABLES
      dynpfields           = it_dynpfields
    EXCEPTIONS
      invalid_abapworkarea = 1
      invalid_dynprofield  = 2
      invalid_dynproname   = 3
      invalid_dynpronummer = 4
      invalid_request      = 5
      no_fielddescription  = 6
      invalid_parameter    = 7
      undefind_error       = 8
      double_conversion    = 9
      stepl_not_found      = 10
      OTHERS               = 11.
  IF sy-subrc EQ 0.
    READ TABLE it_dynpfields INTO wa_dynpfields
                                  WITH KEY fieldname = 'P_VKORG'.
    MOVE wa_dynpfields-fieldvalue TO p_uname.
  ENDIF
9 REPLIES 9
Read only

Former Member
0 Likes
974

Hi,

use function module DYNP_VALUES_READ to get those entered values.

Regards,

Raghava Channooru

Read only

Former Member
0 Likes
975
data: it_dynpfields TYPE STANDARD TABLE OF dynpread,
                   wa_dynpfields TYPE dynpread.

REFRESH it_dynpfields.
  CLEAR wa_dynpfields.
  wa_dynpfields-fieldname = 'P_VKORG'.
  APPEND wa_dynpfields TO it_dynpfields.

  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname               = '<Report Name>'
      dynumb               = '1000'
    TABLES
      dynpfields           = it_dynpfields
    EXCEPTIONS
      invalid_abapworkarea = 1
      invalid_dynprofield  = 2
      invalid_dynproname   = 3
      invalid_dynpronummer = 4
      invalid_request      = 5
      no_fielddescription  = 6
      invalid_parameter    = 7
      undefind_error       = 8
      double_conversion    = 9
      stepl_not_found      = 10
      OTHERS               = 11.
  IF sy-subrc EQ 0.
    READ TABLE it_dynpfields INTO wa_dynpfields
                                  WITH KEY fieldname = 'P_VKORG'.
    MOVE wa_dynpfields-fieldvalue TO p_uname.
  ENDIF
Read only

0 Likes
974

How do I do it for both the field. Do i simply need to append the other one to internal table and then pass it on or do i have to code the same separately for the other one too?

This code and the select query is in inside the perform

INITIALIZATION .

AT SELECTION SCREEN ON VALUE REQUEST FOR SO_STATE LOW.

PERFORM f_value_request_state.

.

Read only

0 Likes
974

at that instance the values will not be filled . i dont think you will be able to get the values using above mentioned function @ that event. but i think you dont have to code the inputs for the search help

Read only

0 Likes
974

Use this FM in event At Selection-Screen Output.

Write your select query and use the FM to fetch the values. Yes append the two values.

Read only

Former Member
0 Likes
974

is this code is after at selection screen or start of selection

Read only

0 Likes
974

Hi,

You should use the FM before your SELECT statement.

Thanks,

Shashidhar

Read only

0 Likes
974

Hi,

APPEND the two values to the internal table and pass it to the FM.

Thanks,

Shashidhar

Read only

0 Likes
974

The FM works in AT SELECTION-SCREEN ON VALUE-REQUEST.

I have tested it.

Please let me know if you have any questions.

Thanks,

Shashidhar