This website is not affiliated with, sponsored by, or approved by SAP AG.

Creating own help & f4 .

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Creating own help & f4 .

Postby Guest » Mon Feb 24, 2003 8:18 am

Can anybody send me code for creation of own F1 & F4 .

thanks in advance !
Guest
 

Postby Guest » Mon Feb 24, 2003 8:24 am

option search help, via se11
Guest
 

Postby Rich » Mon Feb 24, 2003 8:34 am

This is a macro that I use all the time. Include it in your program and then call it like so:

F4_VALUE_REQUEST input_parameter checktable description_field column_titles1 2 3

Code: Select all
*----------------------------------------------------------------------*
*   INCLUDE Y_F4_VALUES                                                *
*----------------------------------------------------------------------*
*
*
          Define Insert_Separators.
                 Move '|' to t_f4_help-col1.
                 Move '|' to t_f4_help-col2.
                 Move '|' to t_f4_help-col3.
                 Move '|' to t_f4_help-col4.
          End-of-Definition.

* Macro F4_Value_Request
*
* &1    Parameter for F4 Value Request from ABAP program
* &2    Table to select possible values from for &1
* &3    Field for Parameter from relevant table
* &4    Field for description of &3
* &5,6 and 7 - Text headers for columns
*
Define F4_Value_Request.
*
       At Selection-Screen on value-request for &1.
*
*
*         At the moment,  select all company codes,
*
          Data: Begin of t_f4_help occurs 0,
                      Col1    type c,
                      &3      like &2-&3,
                      Col2    type c,
                      &4      like &2-&4,
                      Col3    type c,
                End of t_f4_help,
*
                w_choise           like sy-tabix,
                w_lines            like sy-tabix,
                w_endpos_col       type i.
*
          Move sy-uline to t_f4_help.
          Append t_f4_help.
          Move &5 to t_f4_help-&3.
          Move &6 to t_f4_help-&4.
          Move &7 to t_f4_help-IAS.
          Insert_Separators.
          Append t_f4_help.
          Move sy-uline to t_f4_help.
          Append t_f4_help.
          Select &3 &4
            into (t_f4_help-&3,
                  t_f4_help-&4)
            from &2
           where spras = sy-langu.
                 Append t_f4_help.
          EndSelect.
          Loop at t_f4_help.
               If sy-tabix > 3.
                  Insert_Separators.
                  Modify t_f4_help.
               EndIf.
          EndLoop.
          Move sy-uline to t_f4_help.
          Append t_f4_help.
*
          Describe table t_f4_help lines w_lines.
          If w_lines > 4.
*
*            Display....
*
*            Calculate the width of the table.
*
             Read Table t_f4_help index 1.
             Compute w_endpos_col = 10 + strlen( t_f4_help ).
             Call Function 'POPUP_WITH_TABLE_DISPLAY'
               Exporting
                  Endpos_Col         = w_endpos_col
                  Endpos_Row         = 25
                  Startpos_Col       = 10
                  Startpos_Row       = 10
                  Titletext          = &6
               Importing
                  Choise             = w_choise
               Tables
                  Valuetab           = t_f4_help
               Exceptions
                  Break_Off          = 1
                  Others             = 2.
             If sy-subrc  = 0.
*
*               Make sure that they haven't selected a title or an
*               underscore.
*
                If w_choise > 3
                   and w_choise < w_lines.
                       Read Table t_f4_help index w_choise.
                       Move t_f4_help-&3 to &1.
                EndIf.
             EndIf.
          Else.
             Message W000 with 'No Values For List'.
          EndIf.
End-of-definition.



Regards

Rich
Rich
 
Posts: 7112
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool

F4 help in Dynpro

Postby Robb » Mon Feb 24, 2003 8:53 am

PROCESS BEFORE OUTPUT.
...
PROCESS AFTER INPUT.
...
PROCESS ON VALUE-REQUEST.
* " F4-Help
FIELD <name_of_the_dynprofield> MODULE VALUE.

*-------------------------------------------------------------
MODULE VALUE INPUT.

REFRESH gt_HELPTAB.
CLEAR gt_HELPTAB.

* fill the help-tab...
SELECT DISTINCT *
INTO CORRESPONDING FIELDS OF TABLE gt_HELPTAB
FROM <DB_TABLES>
WHERE ...
***
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
RETFIELD = 'FIELD1'
* PVALKEY = ' '
DYNPPROG = sy-repid
DYNPNR = sy-dynnr
DYNPROFIELD = 'NAME OF THE DYNPROFIELD'
* STEPL = 0
* WINDOW_TITLE =
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
TABLES
VALUE_TAB = gt_HELPTAB
* FIELD_TAB =
* RETURN_TAB =
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 3
.

ENDMODULE.





*-------------------------------------- in TOP-INCLUDE
*----------------- for example:
TYPES: BEGIN OF VALUES,
SSU TYPE ZAPSSU,
TEXT TYPE DD07V-DDTEXT,
END OF VALUES.

DATA: gt_HELPTAB TYPE TABLE OF VALUES_SSU WITH HEADER LINE.
*-----------------------------------------
Robb
 


Return to ABAP

Who is online

Users browsing this forum: Google [Bot] and 6 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.