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 descriptions

Former Member
0 Likes
599

Hi all help me in the issue .

I am having Selection screen with the field sales order type when the user enter particular sales order type the description of the sales order type should come correspondig to the order type how to acheive the same

Thanks in advance

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
560

This should help:

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS p_vkorg TYPE vkorg.

SELECTION-SCREEN COMMENT 20(40) v_name.

SELECTION-SCREEN END OF LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vkorg.

  DATA: it_ret TYPE STANDARD TABLE OF ddshretval,
        wa_ret TYPE ddshretval,
        it_dynnr TYPE STANDARD TABLE OF dynpread,
        wa_dynnr TYPE dynpread.

  CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
    EXPORTING
      tabname           = `TVKO`
      fieldname         = `VKORG`
      dynpprog          = sy-repid
      dynpnr            = sy-dynnr
      dynprofield       = `P_VKORG`
    TABLES
      return_tab        = it_ret
    EXCEPTIONS
      field_not_found   = 1
      no_help_for_field = 2
      inconsistent_help = 3
      no_values_found   = 4
      OTHERS            = 5.
  IF sy-subrc = 0.
    READ TABLE it_ret INTO wa_ret INDEX 1.
    CHECK sy-subrc = 0.

    p_vkorg = wa_ret-fieldval.
    SELECT SINGLE vtext FROM tvkot INTO v_name
      WHERE
      spras = sy-langu AND
      vkorg = p_vkorg.

    wa_dynnr-fieldname = `V_NAME`.
    wa_dynnr-fieldvalue = v_name.
    APPEND wa_dynnr TO it_dynnr.

    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        dyname               = sy-repid
        dynumb               = sy-dynnr
      TABLES
        dynpfields           = it_dynnr
      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 NE 0.
*     Can't help
    ENDIF.

  ENDIF.

3 REPLIES 3
Read only

Former Member
0 Likes
560

You could implement customized value help for sale order type.

In AT SELECTION SCREEN ON VALUE HELP event, call the FM: F4IF_INT_TABLE_VALUE_REQUEST.

FM will return selected order type , then you chould get order type description from table TVAKT,

Then update selection screen field value with fm DYNP_VALUES_UPDATE

Read only

umashankar_sahu
Active Participant
0 Likes
560

Hello Dear,

Check in Maintenance View " V_TVAK " field Name of Description for sales order type id BEZEI.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
561

This should help:

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS p_vkorg TYPE vkorg.

SELECTION-SCREEN COMMENT 20(40) v_name.

SELECTION-SCREEN END OF LINE.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vkorg.

  DATA: it_ret TYPE STANDARD TABLE OF ddshretval,
        wa_ret TYPE ddshretval,
        it_dynnr TYPE STANDARD TABLE OF dynpread,
        wa_dynnr TYPE dynpread.

  CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
    EXPORTING
      tabname           = `TVKO`
      fieldname         = `VKORG`
      dynpprog          = sy-repid
      dynpnr            = sy-dynnr
      dynprofield       = `P_VKORG`
    TABLES
      return_tab        = it_ret
    EXCEPTIONS
      field_not_found   = 1
      no_help_for_field = 2
      inconsistent_help = 3
      no_values_found   = 4
      OTHERS            = 5.
  IF sy-subrc = 0.
    READ TABLE it_ret INTO wa_ret INDEX 1.
    CHECK sy-subrc = 0.

    p_vkorg = wa_ret-fieldval.
    SELECT SINGLE vtext FROM tvkot INTO v_name
      WHERE
      spras = sy-langu AND
      vkorg = p_vkorg.

    wa_dynnr-fieldname = `V_NAME`.
    wa_dynnr-fieldvalue = v_name.
    APPEND wa_dynnr TO it_dynnr.

    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        dyname               = sy-repid
        dynumb               = sy-dynnr
      TABLES
        dynpfields           = it_dynnr
      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 NE 0.
*     Can't help
    ENDIF.

  ENDIF.