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

f4 help

Former Member
0 Likes
1,215

hai abapers,

ihave req like

in production order co01.

material:

palnt:

ordertype:

when i give material based on plant

my req is to when i click f4 help on order type i should get ordertypes values with respective plant.

like my plant is hsd01

i should get order type values with respective to plant hsd01.

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
1,183

You have to maintain [POV event with repsecting values|http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/frameset.htm]

Regards

Marcin

9 REPLIES 9
Read only

MarcinPciak
Active Contributor
0 Likes
1,184

You have to maintain [POV event with repsecting values|http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/frameset.htm]

Regards

Marcin

Read only

Former Member
0 Likes
1,183

HI

check this sample code..

[http://help.sap.com/saphelp_nw04/helpdata/en/79/34a246d9b511d1950e0000e8353423/frameset.htm]

Regards

VAsavi kotha

Read only

Former Member
0 Likes
1,183

You have write the code in search help exit of Order type.

Or you can do this using field exit.

Thanks,

Srinivas

Edited by: Srinivas R on Jan 7, 2009 9:11 PM

Read only

Former Member
0 Likes
1,183

Hi,

This problem can be solved by using the FM -'DYNP_VALUES_READ' and finally 'F4IF_INT_TABLE_VALUE_REQUEST' .

attaching the code snippet below.

  • Add a module that gives a f4 help on the order in the event ON VALUE-REQUEST
    PROCESS ON VALUE-REQUEST.
      FIELD <ordertypevariable declared in the program> MODULE ORDER_TYPE.
    
    
    *Code for the ORDER_TYPE 
    MODULE ORDER_TYPE INPUT.
    
    *READ THE NAME OF THE TEXT FIELD INTO THE FIELDNAME OF THE ITAB CREATED
    * this itab2 is declared as the 
    *DATA : ITAB2 TYPE STANDARD TABLE OF DYNPREAD WITH HEADER LINE.
    ITAB2-FIELDNAME = '<plantypevariable declared>'.
    
    * FIANLLY APPNEDING THE READ VALUE INTO THE ITAB2
    APPEND ITAB2.
    
    *CALL THE FUNCTION MUDULE WHICH ACTUALLY READ THE VALUE FROM THE SCREEN
    CALL FUNCTION 'DYNP_VALUES_READ'
      EXPORTING
        DYNAME                               = '<programname>'
        DYNUMB                               = '<screen number>'
    *   TRANSLATE_TO_UPPER                   = ' '
    *   REQUEST                              = ' '
    *   PERFORM_CONVERSION_EXITS             = ' '
    *   PERFORM_INPUT_CONVERSION             = ' '
    *   DETERMINE_LOOP_INDEX                 = ' '
    *   START_SEARCH_IN_CURRENT_SCREEN       = ' '
    *   START_SEARCH_IN_MAIN_SCREEN          = ' '
    *   START_SEARCH_IN_STACKED_SCREEN       = ' '
    *   START_SEARCH_ON_SCR_STACKPOS         = ' '
    *   SEARCH_OWN_SUBSCREENS_FIRST          = ' '
    *   SEARCHPATH_OF_SUBSCREEN_AREAS        = ' '
      TABLES
        DYNPFIELDS                           = ITAB2
    * 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 <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    
    * READ THE VALUE ENTERD IN THE ITAB2 from the above fm
    READ TABLE ITAB2 INDEX 1.
    
    *FIANLLY READ THE FIELD VALE FROM THE FIELDNAME plant type INTO THE TEXT BOX,SO THAT IT CAN BE USED IN THE SELECT BELOW
    <variable used for plant type> = ITAB2-FIELDVALUE.
    
    *SELECTING THE order type CORRESPONDING TO THE plant type ENETERED
    SELECT <ordertypefield> FROM <table> INTO TABLE <itab declared of type table> WHERE <plantypefield> = <plantypefield>.
    
    
    * finally get the f4 help on the order type depeneding on the plant type
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
    *   DDIC_STRUCTURE         = ' '
        RETFIELD               = '<ordertype variable>'
    *   PVALKEY                = ' '
       DYNPPROG               = '<program name>'
       DYNPNR                 = '<screen name>'
       DYNPROFIELD            = '<order field>'
    *   STEPL                  = 0
    *   WINDOW_TITLE           =
    *   VALUE                  = ' '
       VALUE_ORG              = 'S'
    *   MULTIPLE_CHOICE        = ' '
    *   DISPLAY                = ' '
    *   CALLBACK_PROGRAM       = ' '
    *   CALLBACK_FORM          = ' '
    *   MARK_TAB               =
    * IMPORTING
    *   USER_RESET             =
      TABLES
        VALUE_TAB              = ITAB
    *   FIELD_TAB              =
    *   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.
    
    
    ENDMODULE.

Hope this will solve your problem.

Pooja

Read only

Former Member
0 Likes
1,183

hi,

try this


MODULE GET_F4_HELP INPUT.

  TYPES : BEGIN OF EMPLOYEE,
          EMPNO TYPE ZTG_EMP-EMPNO,
          END OF EMPLOYEE.

  DATA : EMPTAB TYPE STANDARD TABLE OF EMPLOYEE WITH HEADER LINE,
         TB_DYNPFIELDS LIKE DYNPREAD OCCURS 0 WITH HEADER LINE,
         PLAN_ID TYPE ZTG_HEALTH-PLAN_ID.


  CLEAR:   TB_DYNPFIELDS.
  REFRESH: TB_DYNPFIELDS.

  MOVE 'ZTG_EMP-HLTH_PLAN' TO TB_DYNPFIELDS-FIELDNAME.
  APPEND TB_DYNPFIELDS.

  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      DYNAME                               = 'SAPMZTG01'
      DYNUMB                               = '1010'
*   TRANSLATE_TO_UPPER                   = ' '
*   REQUEST                              = ' '
*   PERFORM_CONVERSION_EXITS             = ' '
*   PERFORM_INPUT_CONVERSION             = ' '
*   DETERMINE_LOOP_INDEX                 = ' '
*   START_SEARCH_IN_CURRENT_SCREEN       = ' '
*   START_SEARCH_IN_MAIN_SCREEN          = ' '
*   START_SEARCH_IN_STACKED_SCREEN       = ' '
*   START_SEARCH_ON_SCR_STACKPOS         = ' '
*   SEARCH_OWN_SUBSCREENS_FIRST          = ' '
*   SEARCHPATH_OF_SUBSCREEN_AREAS        = ' '
    TABLES
      DYNPFIELDS                           = TB_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 <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  READ TABLE TB_DYNPFIELDS INDEX 1.
  IF SY-SUBRC EQ 0.
    PLAN_ID = TB_DYNPFIELDS-FIELDVALUE.
  ENDIF.

  SELECT EMPNO FROM ZTG_EMP
  INTO TABLE EMPTAB
  WHERE HLTH_PLAN = PLAN_ID.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
*     DDIC_STRUCTURE         = ' '
    RETFIELD               = 'EMPNO'
*     PVALKEY                = ' '
   DYNPPROG               = 'SAPMZTG01'
   DYNPNR                 = '1010'
   DYNPROFIELD            = 'TB1'
*     STEPL                  = 0
*     WINDOW_TITLE           =
*     VALUE                  = ' '
     VALUE_ORG              = 'S'
*     MULTIPLE_CHOICE        = ' '
*     DISPLAY                = ' '
*     CALLBACK_PROGRAM       = ' '
*     CALLBACK_FORM          = ' '
*     MARK_TAB               =
*   IMPORTING
*     USER_RESET             =
  TABLES
    VALUE_TAB              = EMPTAB
*     FIELD_TAB              =
*     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.



ENDMODULE.                 " GET_F4_HELP  INPUT 

hope this help you

Read only

Former Member
0 Likes
1,183

Hi,

fisrt of all select all your "order type" based on the entered plants in your selection-screen, by using "dynpro_values_read" function module, in "selection-screen on values request" for "order type".

pass these selected values "order types" to the function module "F4_intf*" function module, it will display all the "order types" belongs the selected plants.

Regards,

Anki Reddy.

Read only

faisalatsap
Active Contributor
0 Likes
1,183

Hi, Ajay,

Please go through the following Threads you will find you Answer

Please Replay if any Issue,

Kind Regards,

Faisal

Read only

Former Member
0 Likes
1,183

Hi,

Try to create the search help in se11.

in selection mathod give the name of the plant field and in search help parameter gives the name of the

order type field. it will directly implement the f4 help on the field based upon the selection mathode inputs.

hope it will help you.

Regards

Rajesh Kumar

Edited by: Rajesh Kumar on Jan 12, 2009 7:17 AM

Read only

Former Member
0 Likes
1,183

ok