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 parameters

Former Member
0 Likes
751

Dear All,

I need some code for the the following issue:

I have 1 selection screen which has 2 parameters vkorg and vtweg.So whenever I provide some input to vkorg the input value for vtweg should automatically be displayed on the selection screen(based on vkorg).

for example: For vkorg 300009 if vtweg is 10 then whenever u select 300009 in vkorg,10 should be displayed in vtweg field.

Thanks in advance!

Kiran

6 REPLIES 6
Read only

Former Member
0 Likes
711

Hi!

Your requirements could be programmed within the "AT SELECTION SCREEN" event, if theres only 1 VTWEG for each VKORG.

But there could be mugh more VTWEG for each VKORG, so I think it could not be solved.

Regards

Tamá

Read only

Former Member
0 Likes
711

Hi,

For that u have to write code in event

At selection Screen.

like if p_vkorg is not initial.

fetch vtweg from table into a variable based on VKORG and assign that value to the parameter.

Regards

Sandipan

Read only

Former Member
0 Likes
711

Hi,

Coding wont be possible but I can suggest you some logic.

You need to use the event AT-SELECTION-SCREEN-OUTUT.

There you need to make use of FM DYNP_VALUES_READ to capture values and then you can display them.

Refer some thread

[;

[;

regards

Sourabhh verma

Read only

venkat_o
Active Contributor
0 Likes
711

Hi Kiran, The following sample program is suitable for ur requirement. You have to use function module DYNP_VALUES_UPDATE to update automatically. Execute and check the program once.

REPORT zvenkat_head MESSAGE-ID zmsg .
*&---------------------------------------------------------------------*
" Declaration part
*&---------------------------------------------------------------------*
TYPES:
   BEGIN OF t_t001w,
     werks       TYPE t001w-werks,
     name1       TYPE t001w-name1,
   END OF t_t001w,
   t_return_tab  TYPE ddshretval.
DATA:
    w_t001w      TYPE t_t001w,
    w_return_tab TYPE t_return_tab.
DATA:
    i_t001w      TYPE STANDARD TABLE OF t_t001w,
    i_return_tab TYPE STANDARD TABLE OF t_return_tab.
*&---------------------------------------------------------------------*
"SELECTION-SCREEN
*&---------------------------------------------------------------------*

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS :p_werks TYPE t001w-werks,
            p_name1 TYPE t001w-name1.
SELECTION-SCREEN END OF BLOCK b1.

*&---------------------------------------------------------------------*
" AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_werks
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_werks.
  PERFORM f4_help_for_palant.

*&---------------------------------------------------------------------*
*&      Form  f4_help_for_palant
*&---------------------------------------------------------------------*
FORM f4_help_for_palant.

  DATA:
      w_dynpfields TYPE dynpread,
      i_dynpfields LIKE STANDARD TABLE OF dynpread.

  IF i_t001w[] IS INITIAL.
    SELECT werks name1
    FROM t001w
    INTO TABLE i_t001w.
  ENDIF.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
*   DDIC_STRUCTURE         = ' '
    retfield               = 'WERKS'
*   PVALKEY                = ' '
    dynpprog               = sy-repid
    dynpnr                 = sy-dynnr
    dynprofield            = 'P_WERKS'
*   STEPL                  = 0
*   WINDOW_TITLE           =
*   VALUE                  = ' '
   value_org              = 'S'
*   MULTIPLE_CHOICE        = ' '
*   DISPLAY                = ' '
*   CALLBACK_PROGRAM       = ' '
*   CALLBACK_FORM          = ' '
*   MARK_TAB               =
* IMPORTING
*   USER_RESET             =
    TABLES
      value_tab              = i_t001w
*   FIELD_TAB              =
    return_tab             = i_return_tab
*   DYNPFLD_MAPPING        =
* EXCEPTIONS
*   PARAMETER_ERROR        = 1
*   NO_VALUES_FOUND        = 2
*   OTHERS                 = 3
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
  READ TABLE i_return_tab INTO w_return_tab INDEX 1.
  p_werks = w_return_tab-fieldval.
  READ TABLE i_t001w INTO w_t001w WITH KEY werks = p_werks.
  IF sy-subrc = 0.

    w_dynpfields-fieldname    = 'P_NAME1'.
    w_dynpfields-fieldvalue   = w_t001w-name1.
    APPEND w_dynpfields TO i_dynpfields.
    CLEAR w_dynpfields.

    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        dyname               = sy-repid
        dynumb               = sy-dynnr
      TABLES
        dynpfields           = i_dynpfields
      EXCEPTIONS
        invalid_abapworkarea = 1
        invalid_dynprofield  = 2
        invalid_dynproname   = 3
        invalid_dynpronummer = 4
        invalid_request      = 5
        no_fielddescription  = 6
        undefind_error       = 7
        OTHERS               = 8.
    IF sy-subrc = 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.


  ENDIF.


ENDFORM.                    " f4_help_for_palant
I hope that it solves ur problem. Regards, Venkat.O

Read only

Former Member
0 Likes
711

hai u can fallow this way

it may be help full to u .

AT SELECTION-SCREEN OUTPUT .

IF not vkorg = ' '.

LOOP AT SCREEN.

IF SCREEN-NAME = 'vtweg'.

SCREEN-INPUT = 0.

  • SCREEN-ACTIVE = 1.

  • SCREEN-OUTPUT = 0.

select single ..........................

for that field

  • endif.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF SCREEN-NAME = 'S_BUDAT'.

SCREEN-INPUT = 1.

SCREEN-ACTIVE = 1.

SCREEN-OUTPUT = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

try this i think it may be help full to u .

Read only

Former Member
0 Likes
711

Thanks All for your valuable inputs....