Why we use INTO CORRESPONDING FIELDS OF TABLE

why we use INTO CORRESPONDING FIELDS OF TABLE

INTO CORRESPONDING FIELDS OF TABLE  is transferring the value from select clause to itab where the field names are same.
suppose you have
data : begin of itab occurs 0,
         matnr like mara-matnr,
         menge like mseg-menge,
        lgort   like mard-lgort,
       end of itab.
select matnr lgort into table from mard where....
it may give an error because you are not filling menge here or it may fetch the value in matnr and menge field.
but if you use INTO CORRESPONDING FIELDS OF TABLE then it will fetch the data to matnr and lgort field only.
INTO CORRESPONDING FIELDS OF TABLE  is only matching by name not by datatype be careful.
regards
shiba dutta

Similar Messages

  • How to write the quires using into corresponding fields?

    Hi,
      How can i write the below quires using into corresponding fields statement.
    DATA :ws_d_budat TYPE bkpf-budat,
               ws_c_artnr TYPE ce10001-artnr,
    1) SELECT SINGLE budat
                        INTO ws_d_budat
                        FROM bkpf
                        WHERE awtyp = 'VBRK'
                        AND   awkey = wa_vbeln-vbeln.
    2)SELECT vbeln posnr matnr
                   FROM vbrp
                   INTO TABLE i_matnr
                   FOR ALL ENTRIES IN i_vbeln
                   WHERE vbeln = i_vbeln-vbeln
                   AND   matnr = ws_c_artnr
                   AND   posnr NE ' '.
    3) SELECT bukrs belnr gjahr budat awkey
                   INTO TABLE i_budat
                     FROM bkpf
                     FOR ALL ENTRIES IN i_awkey
                       WHERE awtyp = 'VBRK'
                       AND   awkey = i_awkey-awkey.
    Sudhakar

    1) SELECT SINGLE budat
    INTO ws_d_budat
    FROM bkpf
    WHERE awtyp = 'VBRK'
    AND awkey = wa_vbeln-vbeln.  -
    > <b>Not possible</b>
    2)SELECT vbeln posnr matnr
    FROM vbrp
    INTO corresponding fields of TABLE i_matnr
    FOR ALL ENTRIES IN i_vbeln
    WHERE vbeln = i_vbeln-vbeln
    AND matnr = ws_c_artnr
    AND posnr NE ' '.
    3) SELECT bukrs belnr gjahr budat awkey
    INTO corresponding fields of TABLE i_budat
    FROM bkpf
    FOR ALL ENTRIES IN i_awkey
    WHERE awtyp = 'VBRK'
    AND awkey = i_awkey-awkey.
    Reward points if helpful.
    Regards.
    Srikanta Gope

  • Into corresponding fields

    Hi
      I have one performance issue problem, in program i declare structure, internal table and work area. Here in select query i specify into corresponding fields table <it>. here i used into corresponding fields of table is it reduce the performance?
    Please tell me.
    Thanks.

    never use into corresponding fields when we are looking for perfromance issue. as you said 10 fields you are going to display. then
    decalre the internal table body and work area by using those fields (which are required to display output).
    select <require fields> into table <internal table body> from <dbtable> where <condition>.
    if you declare your internal table like below which makes your performance better.
    TYPES: begin of tw_itab,
                end of tw_itab,
             tt_itab type standard table of tw_itab.
    DATA : lw_itab type tw_itab,
               lt_itab type tt_itab.
    regards.
    sriram.

  • What does "into corresponding field" addition used for?

    What does "into corresponding field" addition used for?. I have seen them in open sql statements. Please explain?

    before knowing this you have to know how u write select in ABAP....
    think you have a str./internal table itab with this strucutre:
    data: begin of itab occurs 0,
             vbeln like vbak-vbeln,
             posnr like vbap-posnr,
             netwrt like vbap-netwrt,
           end of itab.
    u have to follow the same order in the select statement...
    select vbeln posnr netwrt
    from vbap
    into table itab
    where......
    Think that u had some concern and coudnt write a select in same order then u write it like this...
    Performance wise its very bad...so ppl generally try to eliminate it..
    select  netwrt posnr vbeln 
    from vbap
    into corresponding field of table itab
    where......
    Award points if helpful

  • "Select into corresponding fields" on MaxDB 75

    Dear all,
    we just migrated from Linux/Sap DB to Win2003 64bit /MaxDB (KERNEL 7.5.0 BUILD 030-123-100-791)
    The migration went well and the system is fully available. The perfromances in general have been improved with the new hardware..
    The problem is that there is a customer program, Z* object obviously very important..., that in random way run in very bad way.
    We compared it's execution on the old system and on the new machine , with the same variant.
    In general on the old machine it ran more faster than on new machine, and in these cases on the new machines it need till 3 or 4 times (more than 10 hours) the execution on the old machine.
    Sometimes insted on the new machine, with the same variant, it's executed in very fast way, requiring less time than on the old machine.
    The Data Buffer cache on the new machine has been enlarged, and also the performance parameters from th note for MaxDB 7.5 have beed applied.
    The statistics are refreshed every day.
    When the performances on the new machine become bad for this program there are not exausted resources and there are free work process.
    We noticed only the programm require a lot of time to execute this statement on the new machine:
    SELECT * FROM BSAD
    INTO CORRESPONDING FIELDS OF TABLE TB_BSAD
    WHERE AUGBL EQ P_BELNR
    AND BELNR NE P_BELNR
    AND BUKRS EQ P_BUKRS
    AND GJAHR EQ P_GJAHR.
    Any idea ?
    regards

    Hi Roberto,
    INTO CORRESPONDING FIELDS is the problem.
    The internal table structure ideally should be same as the fields retrieved in the select query.
    Best regards,
    Prashant

  • ]INTO CORRESPONDING FIELDS OF

    When <u>INTO CORRESPONDING FIELDS OF</u> is used in a select statement?

    HI
    The INTO clause defines the target area into which the selection from the SELECT clause is written. Suitable target areas are variables whose data type is compatible with or convertible into that of the selection in the SELECT clause.
    The SELECT clause determines the data type of the target area as follows:
    ·        The linesspecification in the SELECT clause determines the depth of the target area, that is, whether it is a flat or a tabular structure.
    ·        The colsspecification in the SELECT clause determines the structure (line type) of the target area.
    To read data into one, use the following in the INTO clause
    SELECT ... INTO wa ...
    The target area wa must be at least as large as the line to be read into it. When you read the data into wa, its previous contents are overwritten. However, the components of wa that are not affected by the SELECTstatement retain their previous values.
    If the work area is structured, you can use the CORRESPONDING FIELDS addition. This transfers only the contents of fields whose names are identical in the database table and the work area. This includes any alias column names that you specified in the selection.
    Reward all helpfull answers
    Regards
    Pavan

  • Hi guru's why  we are creating mandt field in tables

    hi guru's why  we are creating mandt field in tables

    Hi Sri,
    <b>Mandt</b> - Specifies is your table is client dependent or not.
    If Mandt is used in your table then it is said to be <b>client dependent</b> else it is called as <b>client independent</b>.
    hope above given answes by experts and this will help you..
    <b> Dont forget to Reward for useful answer </b>
    Regards,
    sunil kairam.

  • How to convert select-options table into single field internal table

    Hi,
    My requirement is to convert select-options table into single internal table which has one field.
    e.g. select-options: s_matnr for mara-matnr.
           select-options table can have options  'BT',"EQ", "NE", "GE", "GT", "LE", "LT", "CP" etc. select-options table
           have   Sign:I ,Option:BT, Low: 1, High.10.The new internal table records should be 1,2,3,4,5,6,7,8,9,10.
    Please suggest any function module available for this scenario in SAP.
    Thanks,
    Somi.
    Edited by: somi reddy satti on Sep 15, 2009 3:18 PM

    Hi Sowmya,
    Here is the answer if I understand well of your question.
    Data: begin of gt_mon OCCURS 0,
                  mon(2)             TYPE n,
             end of gt_mon.
    Data: begin of gt_year OCCURS 0,
                  year(4)             TYPE n,
             end of gt_year.
    Select-options: s_period       FOR ptdw_pws_db-kmonth NO-EXTENSION
                                                                                    DEFAULT sy-datum(6)
                                                                                    TO sy-datum(6).
    For example according to above statement period is 201110 is 201201.
    Period field does n't exists in SAP for selection. If your selection is on date based on period which is given on the selection-screen then you need to convert the period to date by concatenating ( or using FM to convert )01 at the end of each period . You need to declare one range table for date to select the data from table.
    loop at s_period.
    gr_date-sign   = s_period-sign.
    gr_date-option = s_period-option.
    COncatenate s_period-low
                          '01'
    into gr_date-high.
    COncatenate s_period-high                   
                           '01'
    into gr_date-low
    append gr_date.                      
    ENDloop.
    Thanks,
    Satheesh

  • How to send value into current field in table control ABAP

    Hi every one,
    Im from VietNam and I dont know much about SAP ABAP. Im find out more about it.
    I have a problem.
    I made a table control with a big internal table at input, it about more than 100 field.
    I can set cursor to the field that I want to send value to.
    And I want to know any way to send value to that field without use the table control's structure.

    Hi Nabheet,
    Chk this thread, it will be useful to u.
    Matchcode Dinamic colum in ALV grid control objects
    ***Reward Points if useful
    Regards
    Gokul

  • "inner join" PLUS "into corresponding fields" in "for all entries"   ???

    SAP provides the following example:
    DATA: BEGIN OF wa,
            struc1 TYPE scarr,
            struc2 TYPE spfli,
          END OF wa.
    DATA itab LIKE SORTED TABLE OF wa
              WITH UNIQUE KEY table_line.
    SELECT *
           FROM scarr
             INNER JOIN spfli ON scarr~carrid = spfli~carrid
           INTO TABLE itab.
    LOOP AT itab INTO wa.
      WRITE: / wa-struc1-carrid,
               wa-struc1-carrname,
               wa-struc2-connid.
    ENDLOOP.
    What should the syntax be if:
    1) struc1 is your own type with just a few selected fields from scarr;
    2) struc2 is your own type with just a few selected fields from spfli
    3) you only want these fields in your SELECT (instead of the SELECT *).
    Please provide answer only if you know your code works.
    Thanks.
    djh

    Yes, aRs - thanks.
    Someone in the shop here had an example that I coded from, and it's like yours:
    REPORT  ZFOO.
    TABLES:
      /sapapo/trprod,
      /sapapo/matkey.
    TYPES:
      BEGIN OF tx_trprod_new,
        MATID                TYPE /SAPAPO/MATID,     
        matnr               TYPE /sapapo/matnr,
      END   OF tx_trprod_new.
    DATA:
      it_trprod_new          TYPE STANDARD TABLE OF tx_trprod_new,
      v_num          TYPE i.
      SELECT /sapapo/trprod~matid
             /sapapo/matkey~matnr
        FROM /sapapo/trprod
             JOIN /sapapo/matkey ON /sapapo/trprod~matid = /sapapo/matkey~matid
        INTO
       TABLE it_trprod_new
       WHERE /sapapo/trprod~matid LIKE 'H%'.

  • SELECT .... INTO CORRESPONDING  - Internal table

    How do everyone,
    I have the following work areas and internal table defintion:
    TYPES: BEGIN OF equi_rec,
               equnr,                  " Registration
               herst,                  " Make
               typbz,                  " Model
               zzdept,                 " Department
               zzoperator,             " Operator
               zzregdate,              " Registration Date
            END OF equi_rec.
    DATA:  equi_wa                   TYPE          equi_rec,
           equi_tab                  TYPE TABLE OF equi_rec.
    In the code:
      SELECT *
        INTO CORRESPONDING FIELDS OF TABLE equi_tab
        FROM
             equi.
    The ABAP is falling over at runtime. I have since found out that if
    I comment out the ZZREGDATE in the EQUI_REC above, the program works.
    The ZZREGDATE is defined as a date in the dicionary.
    Can anyone tell me why the program is falling over when I am trying to
    move the date field??
    Any help much apprectaied.
    Thanks in advance
    Andy

    Hi,
    Here is the answer ..
    TYPES: BEGIN OF equi_rec,
    equnr, " Registration
    herst, " Make
    typbz, " Model
    zzdept, " Department
    zzoperator, " Operator
    zzregdate, " Registration Date
    END OF equi_rec.
    If you declare like above, then all the fields will have Charecter type and length is 1, so the EQUNR, HERST and all other fields is charecter type then it is storing the first charecter in this Internal table, but the ZZREGDATE is the date field and it will not store the first charecter from the date field, because if you use the MOVE-CORRESPONDING then you need to write the same type, so that it is giving the dump ..
    after writing the TYPE for ZZREGDATE then the program will run properly, but all the fields will store only the first charecter from the table values,
    you need to give the correct TYPE to all the fields from the data dictionary inorder to store the total value
    Reward points for all the helpful answers
    Regards
    Sudheer

  • Select on MARA resulting into # values in internal table for one field

    Hi Team,
    I have written a SELECT statement on MARA table as below.
    TRY.
            SELECT matnr zzwftag FROM mara CLIENT SPECIFIED
              INTO CORRESPONDING FIELDS OF TABLE gt_mara WHERE
              mandt = sy-mandt AND
              zzwftag NE space
              AND zzwftag IS NOT NULL
              AND zzwftag NE '#'
              AND zzwftag NE '%#%'
              AND zzwftag NE '  '
              AND zzwftag NOT LIKE '%/%'(012).
          CATCH cx_sy_dynamic_osql_error.
            MESSAGE 'Error While Fetching Data from MARA'(044) TYPE 'S'(040)  DISPLAY LIKE 'W'(041).
        ENDTRY.
        IF NOT gt_mara[] IS INITIAL.
          DELETE gt_mara[] WHERE zzwftag EQ '#'
          OR zzwftag IS INITIAL
          OR zzwftag EQ space
          OR zzwftag EQ ' '.
        ENDIF.
    Observations: 1. In
    the resulting internal table I am seeing '#' values for fields zzwftag which are actually empty when I see the record in SE11 in MARA(ALV display). It shows '#' in it in SE16 display(We can choose User parameters and hence mode of display in SE11)
    The requirement is to avoid those records where zzwftag is initial i.e. blank. I tried to delete invalid records but to no avail.
    Please suggest any way where I can get the Select correct.
    Regards,
    Amit

    Please do not use so many not conditions in one query....
    Using so many negative conditions results in bad data.
    Instead use delete statements later this would not confuse the system.
    Also if you are using sy-mandt then i think you should not use client specified system will take care of it.
    TRY.
    SELECT matnr zzwftag FROM mara CLIENT SPECIFIED
    INTO CORRESPONDING FIELDS OF TABLE gt_mara WHERE
    mandt = sy-mandt AND
    zzwftag NE space.
    CATCH cx_sy_dynamic_osql_error.
    MESSAGE 'Error While Fetching Data from MARA'(044) TYPE 'S'(040) DISPLAY LIKE 'W'(041).
    ENDTRY.
    IF NOT gt_mara[] IS INITIAL.
    DELETE gt_mara[] WHERE zzwftag EQ '#'
    OR zzwftag IS INITIAL
    OR zzwftag EQ space
    OR zzwftag EQ ' '.
    delete gt_mara[] where zzwflag eq '%#%'.
    ENDIF.

  • How to read internal table data and use to retrive from other table.

    Hi all,
        I am trying to generate a report using ooabap.
    In this scenario, I retrieved data from one standard table (zcust) and successfully displayed using structure 'i_zcust_final' ( i_zcust_final is similar structure of zcust).  
        Now I want to get some other data from other standard table  (zpurch) using the data in i_zcust_final. How....???? I am unable to read data from i_zcust_final even i kept in loop.
        I am attaching the code here.. even it too long, please look at the code and suggest me what to do.
    code  **************************
    REPORT  ZBAT_OOPS_REPORT1.
    TABLES: ZCUST.
        D E F I N I T I O N     *****
    CLASS BATLANKI_CLS DEFINITION.
      PUBLIC SECTION.
      DATA : ITAB_ZCUST TYPE STANDARD TABLE OF ZCUST,
             I_ZCUST_FINAL LIKE LINE OF ITAB_ZCUST,
             ITAB_ZCUST1 TYPE STANDARD TABLE OF ZCUST.
      TYPES: BEGIN OF IT_ZPURCH,
              CUSTNUM   TYPE ZPURCH-CUSTNUM,
              PURC_DOC  TYPE ZPURCH-PURC_DOC,
              VENDOR    TYPE ZPURCH-VENDOR,
              STATUS    TYPE ZPURCH-STATUS,
              PURC_ORG  TYPE ZPURCH-PURC_ORG,
            END OF IT_ZPURCH.
      DATA : ITAB_ZPURCH TYPE TABLE OF IT_ZPURCH,
             I_ZPURCH_FINAL LIKE LINE OF ITAB_ZPURCH.
      METHODS: GET_ZCUST,
               PRINT_ZCUST,
               GET_ZPURCH.
    ENDCLASS.
    I N I T I A L I Z T I O N   *****
        SELECT-OPTIONS:S_CUSNUM FOR ZCUST-CUSTNUM.
    INITIALIZATION.
    S_CUSNUM-LOW = '0100'.
    S_CUSNUM-HIGH = '9999'.
    S_CUSNUM-OPTION = 'BT'.
    S_CUSNUM-SIGN   = 'I'.
    APPEND S_CUSNUM.
    CLEAR S_CUSNUM.
    I M P L E M E N T A T I O N *****
    CLASS BATLANKI_CLS IMPLEMENTATION.
      METHOD GET_ZCUST.
      SELECT * FROM ZCUST
        INTO TABLE ITAB_ZCUST
       WHERE CUSTNUM IN S_CUSNUM.
    ENDMETHOD.
      METHOD PRINT_ZCUST.
       LOOP AT ITAB_ZCUST INTO I_ZCUST_FINAL.
       WRITE:/ I_ZCUST_FINAL-CUSTNUM,
               I_ZCUST_FINAL-CUSTNAME,
               I_ZCUST_FINAL-CITY,
               I_ZCUST_FINAL-EMAIL.
       ENDLOOP.
      ENDMETHOD.
       METHOD GET_ZPURCH.
    LOOP AT ITAB_ZCUST INTO ITAB_ZCUST1.
      SELECT CUSTNUM
             PURC_DOC
             VENDOR
             STATUS
             PURC_ORG
        FROM ZPURCH
        INTO CORRESPONDING FIELDS OF TABLE ITAB_ZPURCH
        WHERE CUSTNUM EQ I_ZCUST_FINAL-CUSTNUM.
    ENDLOOP.
         LOOP AT ITAB_ZPURCH INTO I_ZPURCH_FINAL.
         WRITE:/ I_ZPURCH_FINAL-CUSTNUM,
                 I_ZPURCH_FINAL-PURC_DOC,
                 I_ZPURCH_FINAL-VENDOR,
                 I_ZPURCH_FINAL-STATUS,
                 I_ZPURCH_FINAL-PURC_ORG.
         ENDLOOP.
    ENDMETHOD.
    ENDCLASS.
      O B J E C T   *****
    DATA: BATLANKI_OBJ TYPE REF TO BATLANKI_CLS.
    START-OF-SELECTION.
    CREATE OBJECT BATLANKI_OBJ.
    CALL METHOD:
                 BATLANKI_OBJ->GET_ZCUST,
                 BATLANKI_OBJ->PRINT_ZCUST,
                 BATLANKI_OBJ->GET_ZPURCH.
    Can anyone suggest me..
      Thanks in advance,
      Surender.

    Hi Surendar..
    There is mistake in the Work area specification in this method.
    METHOD GET_ZPURCH.
    LOOP AT ITAB_ZCUST INTO ITAB_ZCUST1.
    SELECT CUSTNUM
    PURC_DOC
    VENDOR
    STATUS
    PURC_ORG
    FROM ZPURCH
    INTO CORRESPONDING FIELDS OF TABLE ITAB_ZPURCH
    <b>WHERE CUSTNUM EQ      ITAB_ZCUST1-CUSTNUM.</b>           
                                   "Instead of  I_ZCUST_FINAL-CUSTNUM.
    ENDLOOP.
    LOOP AT ITAB_ZPURCH INTO I_ZPURCH_FINAL.
    WRITE:/ I_ZPURCH_FINAL-CUSTNUM,
    I_ZPURCH_FINAL-PURC_DOC,
    I_ZPURCH_FINAL-VENDOR,
    I_ZPURCH_FINAL-STATUS,
    I_ZPURCH_FINAL-PURC_ORG.
    ENDLOOP.
    ENDMETHOD.
    Now it should work..
    One more thing : From performance point of view you have to Replace that loop using FOR ALL ENTRIES . And avoid CORRESPONDING FIELDS. it will be slow.
    This is the code.
    LOOP AT ITAB_ZCUST INTO ITAB_ZCUST1.
    if ITAB_ZCUST[] IS NOT INITIAL.
    SELECT CUSTNUM
    PURC_DOC
    VENDOR
    STATUS
    PURC_ORG
    FROM ZPURCH
    INTO TABLE ITAB_ZPURCH
    <b>for all entries in ITAB_ZCUST1</b>
    <b>WHERE CUSTNUM EQ      ITAB_ZCUST1-CUSTNUM.</b>           
                                   "Instead of  I_ZCUST_FINAL-CUSTNUM.
    ENDIF.
    ENDLOOP.
    <b>Reward if Helpful.</b>

  • How to make use of Index of a table in report to fetch data?

    Hi,
    I need a sample code for select statement which is making use of INDEX of a table
    to fetch data.
    Doubt:
    Can I fetch all the fields in the table by passing certain key fields of INDEX in where condition?

    Hi Raja,
    1) Mention the fields that you wish from database table (incase you don't need all the fields from the database table).
    2) Don't use the INTO CORRESPONDING FIELDS OF TABLE ztable clause.
    3)Instead use INTO TABLE ztable (But take care that during the declaration of the ztable, the fields declared are in order that in database table to fetch the Records in sequence).
    Please Find the Syntax and Code Below..
    SELECT *  FROM <TABLE>
      WHERE  <WHERE>
        %_HINTS ORACLE 'INDEX("<TABLE>~<INDEX ID")'.
    SELECT carrid
    INTO TABLE t_spfli
    FROM spfli
    WHERE carrud IN s_carrid AND
    connid IN s_connid
    %_HINTS ORACLE 'INDEX("&SPFLI&" "SPFLI~XXX")'.
    Hope this Is helpFul
    Thanks
    kalyan

  • How to provide F4 help for a field in table control

    Hi Friends,
    I have requirement like below.
    1.Create one custom transaction code with header and item information.
    2.In item level, we will be designed table control to enter/display the data.
    3.Table control’s first field will be material number and next DOT number (Material may have many DOT numbers) and so on.
    4.First user will enter material number in the table control’s first row’s first field and go to DOT number field.
    5.DOT number has drop down option. If user selects drop down box of DOT number, he gets all the DOT numbers available in database. User selects one DOT number and double clicks on it then it will be populated in DOT number field box.
    But for point number 5,  business wants like when ever user enters material number in table control first field then select DOT number’s drop down then they want to see the particular material’s DOT numbers only in the drop down list for selection. Not all DOT numbers available in data base. Same thing should happen for all item lines in table control.
    Please see below example. 
    Assume data base table has 10 DOT numbers. But material number has only 2 DOT numbers. When ever user enters material number in item level table control and selects DOT number’s drop down then it should show only 2 DOT numbers which are related to particular material number. Not all 10 DOT numbers.
    Could you please suggest me, how can we achieve this?

    Hello,
    Check this :-
    For POV
    Input Help in Dialog Modules
    You can call dialog modules in the POV event using the event keyword PROCESS ON VALUE-REQUEST.
    PROCESS ON VALUE-REQUEST.
    FIELD <f> MODULE <mod>.
    After the PROCESS ON VALUE-REQUEST statement, you can only use the MODULE statement together with the FIELD statement. When the user chooses F4 for a field <f>, the system calls the module <mod> belonging to the FIELD <f> statement. If there is more than one FIELD statement for the same field <f>, only the first is executed. The module <mod> is defined in the ABAP program like a normal PAI module. However, the contents of the screen field <f> are not available, since it is not transported by the FIELD statement during the PROCESS ON HELP-REQUEST event. You can now program your own value lists in the module. However, this procedure is only recommended if it really is not possible to use a search help. Defining search helps is much easier than PROCESS ON VALUE-REQUEST, since the system takes over some of the standard operations, such as getting field contents from the screen. It also ensures that the F4 help has a uniform look and feel throughout the system. Furthermore, it means that you do not have to reassign input help to fields on each screen.
    Despite the introduction of search helps (and search help exits), there are still cases in which you need to use parts of the standard F4 functions directly. In this case, there are some standard function modules that you can use in the POV event. They support search helps, as well as all other kinds of input help, and are responsible for data transport between the screen and the input help. These all have the prefix F4IF_. The most important are:
    F4IF_FIELD_VALUE_REQUEST
    Calls the input help of the ABAP Dictionary dynamically. You can pass the component names of a structure or database table of the ABAP Dictionary to the function module in the import parameters TABNAME and FIELDNAME. The function module starts the ABAP Dictionary input help for this component. All of the relevant screen fields are read. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the user’s selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.
    F4IF_INT_TABLE_VALUE_REQUEST
    This function module displays a value list that you created in an ABAP program. The value list is passed to the function module as the table parameter VALUE_TAB. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the user’s selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.
    There are also two function modules - DYNP_VALUES_READ and DYNP_VALUES_UPDATE - that can read the values of screen fields and return values to them during the POV event. For further information, refer to the relevant function module documentation.
    Input help in dialog modules
    REPORT DEMO_DYNPRO_F4_HELP_MODULE.
    TYPES: BEGIN OF VALUES,
    CARRID TYPE SPFLI-CARRID,
    CONNID TYPE SPFLI-CONNID,
    END OF VALUES.
    DATA: CARRIER(3) TYPE C,
    CONNECTION(4) TYPE C.
    DATA: PROGNAME LIKE SY-REPID,
    DYNNUM LIKE SY-DYNNR,
    DYNPRO_VALUES TYPE TABLE OF DYNPREAD,
    FIELD_VALUE LIKE LINE OF DYNPRO_VALUES,
    VALUES_TAB TYPE TABLE OF VALUES.
    CALL SCREEN 100.
    MODULE INIT OUTPUT.
    PROGNAME = SY-REPID.
    DYNNUM = SY-DYNNR.
    CLEAR: FIELD_VALUE, DYNPRO_VALUES.
    FIELD_VALUE-FIELDNAME = 'CARRIER'.
    APPEND FIELD_VALUE TO DYNPRO_VALUES.
    ENDMODULE.
    MODULE CANCEL INPUT.
    LEAVE PROGRAM.
    ENDMODULE.
    MODULE VALUE_CARRIER INPUT.
    CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
    EXPORTING
    TABNAME = 'DEMOF4HELP'
    FIELDNAME = 'CARRIER1'
    DYNPPROG = PROGNAME
    DYNPNR = DYNNUM
    DYNPROFIELD = 'CARRIER'.
    ENDMODULE.
    MODULE VALUE_CONNECTION INPUT.
    CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
    DYNAME = PROGNAME
    DYNUMB = DYNNUM
    TRANSLATE_TO_UPPER = 'X'
    TABLES
    DYNPFIELDS = DYNPRO_VALUES.
    READ TABLE DYNPRO_VALUES INDEX 1 INTO FIELD_VALUE.
    SELECT CARRID CONNID
    FROM SPFLI
    INTO CORRESPONDING FIELDS OF TABLE VALUES_TAB
    WHERE CARRID = FIELD_VALUE-FIELDVALUE.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    RETFIELD = 'CONNID'
    DYNPPROG = PROGNAME
    DYNPNR = DYNNUM
    DYNPROFIELD = 'CONNECTION'
    VALUE_ORG = 'S'
    TABLES
    VALUE_TAB = VALUES_TAB.
    ENDMODULE.
    The next screen (statically defined) for screen 100 is itself. It has the following layout:
    The input fields have been adopted from the program fields CARRIER and CONNECTION. The pushbutton has the function code CANCEL with function type E.
    The screen flow logic is as follows:
    PROCESS BEFORE OUTPUT.
    MODULE INIT.
    PROCESS AFTER INPUT.
    MODULE CANCEL AT EXIT-COMMAND.
    PROCESS ON VALUE-REQUEST.
    FIELD CARRIER MODULE VALUE_CARRIER.
    FIELD CONNECTION MODULE VALUE_CONNECTION.
    When the user chooses input help for the individual fields, the following is displayed:
    For the Airline field, the POV module VALUE_CARRIER is called. The function module F4IF_FIELD_VALUE_REQUEST displays the input help for the component CARRIER1 of the structure DEMOF4HELP from the ABAP Dictionary, namely the search help DEMOF4DE. The user’s selection is returned to the screen field CARRIER.
    For the Flight number field, the POV module VALUE_CONNECTION is called. The function module DYNP_VALUE_READ transports the value of the screen field CARRIER into the program. The program then reads the corresponding values from the database table SPFLI into the internal table VALUES_TAB using a SELECT statement, and passes the internal table to F4IF_INT_TABLE_VALUE_REQUEST. This displays the internal table as input help, and places the user’s selection into the screen field CONNECTION.
    For POH------------
    Field Help
    There are three ways of displaying field help for screen elements:
    Data Element Documentation
    If you place a field on the screen in the Screen Painter by copying a ABAP Dictionary field, the corresponding data element documentation from the ABAP Dictionary is automatically displayed when the user chooses field help (as long as the help has not been overridden in the screen flow logic).
    For further information about creating data element documentation, refer to data elements.
    Data Element Supplement Documentation
    If the data element documentation is insufficient, you can expand it by writing a data element supplement
    Data element supplement documentation contains the heading Definition, as well as the following others:
    Use
    Procedure
    Examples
    Dependencies
    To create data element supplement documentation for a screen, choose Goto ® Documentation ® DE supplement doc. from the element list of the screen. A dialog box appears in which the system proposes a number as the identified for the data element supplement. You can then enter help texts for the above headings using the SAPscript editor.
    Data element supplement documentation created in this way is program- and screen-specific. Any data element supplement documentation created in the ABAP Dictionary with the same number is overridden by the screen-specific documentation. You can link existing data element supplement documentation created in the ABAP Dictionary with a screen field by using the table THLPF. To do this, crate a new row in THLPF containing the following data: Program name, screen name, field name, and number of the data element supplement documentation.
    To display data element supplement documentation, you must code the following screen flow logic in the POH event:
    PROCESS ON HELP-REQUEST.
    FIELD <f> [MODULE <mod>] WITH <num>.
    After PROCESS ON HELP-REQUEST, you can only use FIELD statements. If there is no PROCESS ON HELP-REQUEST keyword in the flow logic of the screen, the data element documentation for the current field, or no help at all is displayed when the user chooses F1. Otherwise, the next FIELD statement containing the current field <f> is executed.
    If there is screen-specific data element supplement documentation for the field <f>, you can display it by specifying its number <num>. The number <num> can be a literal or a variable. The variable must be declared and filled in the corresponding ABAP program.
    You can fill the variables, for example, by calling the module <mod> before the help is displayed. However, the FIELD statement does not transport the contents of the screen field <f> to the ABAP program in the PROCESS ON HELP-REQUEST event.
    For further information about data element supplement documentation, refer to Data Element Supplements.
    Calling Help Texts from Dialog Modules
    If data element supplement documentation is insufficient for your requirements, or you want to display help for program fields that you have not copied from the ABAP Dictionary, you can call dialog modules in the POH event:
    PROCESS ON HELP-REQUEST.
    FIELD <f> MODULE <mod>.
    After the PROCESS ON HELP-REQUEST statement, you can only use the MODULE statement together with the FIELD statement. When the user chooses F1 for a field <f>, the system calls the module <mod> belonging to the FIELD <f> statement. If there is more than one FIELD statement for the same field <f>, only the first is executed. However, the contents of the screen field <f> are not available in the module <mod>, since it is not transported by the FIELD statement during the PROCESS ON HELP-REQUEST event. The field help should not be dependent on the user input.
    The module <mod> is defined in the ABAP program like a normal PAI module. The processing logic of the module must ensure that adequate help is displayed for the field in question. Instead of calling an extra screen with text fields, you should use one of the following function modules to display a suitable SAPscript document:
    HELP_OBJECT_SHOW_FOR_FIELD
    This function module displays the data element documentation for components of any structure or database table from the ABAP Dictionary. You pass the name of the component and structure or table to the import parameters FIELD and TABLE.
    HELP_OBJECT_SHOW
    Use this function module to display any SAPscript document. You must pass the document class (for example, TX for general texts, DE for data element documentation) and the name of the document to the import parameters DOKCLASS and DOKNAME. For technical reasons, you must also pass an empty internal table with the line type TLINE to the tables parameter of the function module.
    For further information about how to create SAPscript documents, refer to the Documentation of System Objects documentation.
    Field help on screens.
    REPORT DEMO_DYNPRO_F1_HELP.
    DATA: TEXT(30),
    VAR(4),
    INT TYPE I,
    LINKS TYPE TABLE OF TLINE,
    FIELD3, FIELD4.
    TABLES DEMOF1HELP.
    TEXT = TEXT-001.
    CALL SCREEN 100.
    MODULE CANCEL INPUT.
    LEAVE PROGRAM.
    ENDMODULE.
    MODULE F1_HELP_FIELD2 INPUT.
    INT = INT + 1.
    CASE INT.
    WHEN 1.
    VAR = '0100'.
    WHEN 2.
    VAR = '0200'.
    INT = 0.
    ENDCASE.
    ENDMODULE.
    MODULE F1_HELP_FIELD3 INPUT.
    CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD'
    EXPORTING
    DOKLANGU = SY-LANGU
    DOKTITLE = TEXT-002
    CALLED_FOR_TAB = 'DEMOF1HELP'
    CALLED_FOR_FIELD = 'FIELD1'.
    ENDMODULE.
    MODULE F1_HELP_FIELD4 INPUT.
    CALL FUNCTION 'HELP_OBJECT_SHOW'
    EXPORTING
    DOKCLASS = 'TX'
    DOKLANGU = SY-LANGU
    DOKNAME = 'DEMO_FOR_F1_HELP'
    DOKTITLE = TEXT-003
    TABLES
    LINKS = LINKS.
    ENDMODULE.
    The next screen (statically defined) for screen 100 is 100. It has the following layout:
    The screen fields DEMOf1HELP-FIELD1 and DEMOF1HELP-FIELD2 from the ABAP Dictionary and the program fields FIELD3 and FIELD4 are assigned to the input fields. The pushbutton has the function code CANCEL with function type E.
    The screen flow logic is as follows:
    PROCESS BEFORE OUTPUT.
    PROCESS AFTER INPUT.
    MODULE CANCEL AT EXIT-COMMAND.
    PROCESS ON HELP-REQUEST.
    FIELD DEMOF1HELP-FIELD2 MODULE F1_HELP_FIELD2 WITH VAR.
    FIELD FIELD3 MODULE F1_HELP_FIELD3.
    FIELD FIELD4 MODULE F1_HELP_FIELD4.
    The components FIELD1 and FIELD2 of structure DEMOF1HELP both refer to the data element DEMOF1TYPE. This data element is documented, and also has two supplements with numbers 0100 and 0200.
    The following field help is displayed:
    When the user chooses F1 on the input field for DEMOF1HELP-FIELD1, the data element documentation for DEMOF1TYPE is displayed, since the field does not occur in the PROCESS ON HELP-REQUEST event.
    If the user chooses F1 repeatedly for the input field DEMOF1HELP-FIELD2, the data element documentation is displayed, along with the supplement documentation for either 0100 or 0200 alternately. The variable VAR is filled in the dialog module F1_HELP_FIELD2.
    When the user chooses F1 on the input field for FIELD3, the data element documentation for DEMOF1TYPE is displayed, since this is called in the dialog module F1_HELP_FIELD3 by the function module HELP_OBJECT_SHOW_FOR_FIELD.
    When the user chooses F1 on the input field for FIELD4, the SAPscript documentation DEMO_FOR_F1_HELP is displayed, since this is called in the dialog module F1_HELP_FIELD4 by the function module HELP_OBJECT.
    Regards,
    Deepu.K

Maybe you are looking for

  • Inactive vendor list

    Hi Gurus, How can I get the inactive (not doing business/transaction with us) vendors list for certain period like from the year 2006 till now? Thanks and rgards Durai

  • Which API can use to save PDF document with Adobe Reader 9?

    Hello,     which API can use to save PDF document with Adobe Reader 9? It is said that "CosDocSaveWithParams" can't be used. thanks! jimmy

  • SOLVED: yellow preview link doesn't disappear

    http://cl.ly/1N3M3Y133g2J1b1H132a when i hover over a bookmark, (screenshot) it doesn't disappear even when i open other apps and stays on top of them. FF 4.0.1 Mac OS 10.6.7

  • Listing FTP directory with swing please help me

    hi , please i wanna now how to use JTree with FinJ (ftp package that provides api ) if someone has build an ftp application using FinJ please send it to me in [email protected] or a link to dowload it pleaaaaaaaaaaasee any help will be good ( sorry f

  • Problem when transplant to linux

    originally developed in Windows 2000 now i'm trying to transplant to linux error occured when build client using ant error message is: client-compile: [mkdir] Created dir: /home/zyc/SPI_TOOLKIT_DEV/build-examples/client/classes [javac] Compiling 99 s