Internal Table Manipulation

Hi,
I have an internal tables with 5 fields each of type Char - L1 L2 L3 L4 L5.
I have to make the first occurance of 0 after a non zero value as 1.
Example: if i have the values as 1 0 0 0 0, it s'd be made 1 1 0 0 0.
If 1 1 0 0 0 it s'd be made 1 1 1 0 0.
If 0 1 0 0 0 then it should be made 0 1 1 0 0.
If i try this using nested IF statements the code becomes more complex.. Is there any other way out.. like using string operations??
Regards,
Pradhiba

Pradhiba,
You try the following code:
DATA: BEGIN OF tbl_table1 OCCURS 0,
        f1 TYPE n,
        f2 TYPE n,
        f3 TYPE n,
        f4 TYPE n,
        f5 TYPE n,
      END OF tbl_table1.
DATA: g_index LIKE sy-tabix,
      g_found TYPE c.
FIELD-SYMBOLS: <fs> TYPE n.
START-OF-SELECTION.
  CLEAR tbl_table1.
  tbl_table1-f2 = 1.
  APPEND tbl_table1.
  LOOP AT tbl_table1.
    CLEAR: g_index,
           g_found.
    DO.
      ADD 1 TO g_index.
      ASSIGN COMPONENT g_index OF STRUCTURE tbl_table1 TO <fs>.
      IF sy-subrc NE 0.
        EXIT.
      ENDIF.
* Was there a 1 in the previous field?
      IF g_found = 'X'.
* Yes! Previous field was a 1, now make current field a 1 clear the
* G_FOUND flag and CONTINUE to next field
        <fs> = 1.
        CLEAR g_found.
        CONTINUE.
      ENDIF.
* Current field is a 1, mark the G_FOUND flag!
      IF <fs> = 1.
        g_found = 'X'.
      ENDIF.
    ENDDO.
    MODIFY tbl_table1.
  ENDLOOP.
END-OF-SELECTION.
  LOOP AT tbl_table1.
    WRITE:/ tbl_table1-f1, tbl_table1-f2, tbl_table1-f3, tbl_table1-f4,
            tbl_table1-f5.
  ENDLOOP.
Cheers,
Pat

Similar Messages

  • Regarding Internal Table Manipulation

    Hi All,
    I have a issue when working against Internal Table inside a function module.
    Issue is:
    My I.Table declaration is as below:
    <b>DATA: BEGIN OF i_vbfa_tab OCCURS 0.
              INCLUDE STRUCTURE vbfa.
    DATA: END   OF i_vbfa_tab.</b>
    Then in code i had written following logic:
      SELECT VBELV
             VBELN
             VBTYP_N
             VBTYP_V
             FROM VBFA
             INTO ( V_VBELV, V_VBELN, V_VBTYP_N, V_VBTYP_V )
             WHERE VBELN   = V_SO_ORDER2 AND
                   VBTYP_N = 'G'         AND
                   STUFE   = '00'.
      IF SY-SUBRC EQ 0.
        I_VBFA_TAB–VBELN   = V_VBELN.        
        I_VBFA_TAB–VBELV   = V_VBELV.        
        I_VBFA_TAB–VBTYP_N = V_VBTYP_N.      
        I_VBFA_TAB–VBTYP_V = V_VBTYP_V.      
        APPEND I_VBFA_TAB.
        CLEAR I_VBFA_TAB.
      ENDIF.
    Then when i am checking for <b>F2[Syntax]</b> it is giving error as <b>'The Field I_VBFA_TAB-VBELN is unknown'</b>. This is the case with all 4 assignment statements.
    Can anybody tell me what is the issue over here.
    What can i do to assign those values to internal table and append. I had tried with <b>MOVE</b> that is also giving same error.
    Can anybody solve my issue.
    Thanks in advance.
    Thanks & Regards,
    Prasad.

    If you are doing something like:
    call function 'Z_FUNC'
      tables i_vbfa_tab = vbfa_tab.
    and in the FM:
    function z_func
    *"  TABLES
    *"      i_vbfa_tab STRUCTURE  vbfa OPTIONAL
    perform get_vbfa.
    and then in an include
    form get_vbfa
    SELECT VBELV
    VBELN
    VBTYP_N
    VBTYP_V
    FROM VBFA
    INTO ( V_VBELV, V_VBELN, V_VBTYP_N, V_VBTYP_V )
    WHERE VBELN = V_SO_ORDER2 AND
    VBTYP_N = 'G' AND
    STUFE = '00'.
    I think you'll get the syntax arror you describe. Try:
    call function 'Z_FUNC'
      tables i_vbfa_tab = vbfa_tab.
    and in the FM:
    function z_func
    *"  TABLES
    *"      i_vbfa_tab STRUCTURE  vbfa OPTIONAL
    perform get_vbfa
    <b>  tables i_vbfa_tab.</b>
    and then in the include
    form get_vbfa
    <b>  tables i_vbfa structure vbfa.</b>
    data: v_vbelv   like vbfa-vbelv,
          v_vbeln   like vbfa-vbeln,
          v_VBTYP_N like vbfa-VBTYP_N,
          v_VBTYP_v like vbfa-VBTYP_v,
    SELECT VBELV
    VBELN
    VBTYP_N
    VBTYP_V
    FROM VBFA
    INTO ( V_VBELV, V_VBELN, V_VBTYP_N, V_VBTYP_V )
    WHERE VBELN = V_SO_ORDER2 AND
    VBTYP_N = 'G' AND
    STUFE = '00'.
    IF SY-SUBRC EQ 0.
    I_VBFA_TAB–VBELN = V_VBELN.
    I_VBFA_TAB–VBELV = V_VBELV.
    I_VBFA_TAB–VBTYP_N = V_VBTYP_N.
    I_VBFA_TAB–VBTYP_V = V_VBTYP_V.
    APPEND I_VBFA_TAB.
    CLEAR I_VBFA_TAB.
    ENDIF.
    I didn't test this, so if you use it, test it thoroughly.
    Rob

  • Internal table logic issue

    Hi All,
    I have one logical issue related to internal table manipulation.
    I have one internal table :
    I_DAT - This is related to Loading/Unloading of Goods.
    for example with 3 fields
    VSTEL, KUNNA, KMMANG.
    Now suppose my data looks like this after sorting:
    VSTEL   KUNNA    KMMANG
    100       -        -
    200       -        -
    300       -        -
    400       -        -
    -         500      X
    -         600      X
    -         700      X
    -         800      X
    Here 100,200,300,400 are Loading points.
    ANd 500,600,700,800 are unloading points.
    Now what i want is For loading & Unloading points i need to pick up Address and print one after other.
    But how they need to print is:
    FOR INITIAL LOADING OF
    ADDRESS- For 100
    FIRST STOP: FOR LOADING OF
    ADDRESS- For 200
    SECOND STOP: FOR LOADING OF
    ADDRESS- For 300
    Etc .....
    Then
    FOR UNLOADING OF:
    ADDRESS- For 400
    FIRST STOP: FOR UNLOADING OF
    etc.
    FINAL STOP: FOR FINAL UNLOADING OF
    We might get as many records :
    Can any body give me the logic:
    Printing Address is not a problem:
    But Above every address we need to print FIRST STOP, SECOND etc like that.
    For this i need logic.
    Can anybody give the solution!
    Thanks in advance.
    Thanks & Regards,
    Prasad.

    Try this.I think you want output like this......
    DATA: BEGIN OF LINE,
            CARRID   TYPE SBOOK-CARRID,
            CONNID   TYPE SBOOK-CONNID,
            FLDATE   TYPE SBOOK-FLDATE,
            CUSTTYPE TYPE SBOOK-CUSTTYPE,
            CLASS    TYPE SBOOK-CLASS,
            BOOKID   TYPE SBOOK-BOOKID,
          END OF LINE.
    DATA ITAB LIKE SORTED TABLE OF LINE WITH UNIQUE KEY TABLE LINE.
    SELECT CARRID CONNID FLDATE CUSTTYPE CLASS BOOKID
           FROM SBOOK INTO CORRESPONDING FIELDS OF TABLE ITAB.
    LOOP AT ITAB INTO LINE.
      AT FIRST.
        WRITE / 'List of Bookings'.
        ULINE.
      ENDAT.
        AT NEW CARRID.
          WRITE: / 'Carrid:', LINE-CARRID.
        ENDAT.
          AT NEW CONNID.
            WRITE: / 'Connid:', LINE-CONNID.
          ENDAT.
            AT NEW FLDATE.
              WRITE: / 'Fldate:', LINE-FLDATE.
            ENDAT.
              AT NEW CUSTTYPE.
                WRITE: / 'Custtype:', LINE-CUSTTYPE.
              ENDAT.
                   WRITE: / LINE-BOOKID, LINE-CLASS.
                AT END OF CLASS.
                  ULINE.
                ENDAT.
    ENDLOOP.
    This is also helpful......
    LOOP AT <itab>.
      AT FIRST. ... ENDAT.
        AT NEW <f1>. ...... ENDAT.
          AT NEW <f2 >. ...... ENDAT.
              <single line processing>
          AT END OF <f2>. ... ENDAT.
        AT END OF <f1>. ... ENDAT.
      AT LAST. .... ENDAT.
    ENDLOOP.
    Regards
    Abhishek

  • Logic issues for manipulation of internal table data

    Hi,
    I am having a issue with logic of one program.
    In the <b>XVBAP</b> internal table of <b>SO</b> User Exit.
    We will have fields like
    <b>UPDKZ, POSNR, UEPOS, ZZECD[Z-Field] etc.</b>
    Above fields are related to logic.
    1. Now my first point is:
    <b>We need to capture Records where UPDKZ='D' and ZZECD[Z-Field] is populated.</b>
    For this we will write code as below:
    <b>LOOP AT XVBAP WHERE UPDKZ     EQ C_D   AND
                        ZZECD     NE SPACE.
    Here we will store all fields in I_XVBAP I.Table
    ENDLOOP.</b>
    Supoose we have retrieved records as below:
    <b>VBELN, UPDKZ, POSNR, UEPOS, ZZECD
    100    D   000040   000030 Text1
    100    D   000050   000020 Text2
    100    D   000060   000000 Text3</b>
    2. My second point here is:
    <b>For Every Item[POSNR] we need to get the Higher level item from UEPOS field, If the Higher level Item also has UPDKZ = ‘D’, then move the base unit and all it’s components into an internal table. continue this process till UEPOS for POSNR is 000000 but High item should have UPDKZ = 'D', not only this all items in this chain should have UPDKZ = 'D'.</b>
    Ex:
    <b>Suppose for item 000050 UEPOS is 000020 then goto XVBAP with POSNR = UEPOS[000020] and UPDKZ = 'D' if yes and then pick up UEPOS for 000020 item and continue this process till UEPOS becomes 000000 and UPDKZ = 'D'.
    Here from Low level to High level all the chain items should have UPDKZ = 'D'. Then only write all items into Final Internal table.</b>
    <b>Need to do this process for all above rec's [40,50,60 - POSNR].</b>
    Can anybody provide me the logic for the above scenario.
    Thanks in advance.
    Thanks and Regards,
    Deep

    Hi Anurag,
    Your assumption is wrong.
    See first when we get into our logic we will get <b>XVBAP</b> data as below:
    <b>VBELN, POSNR, UEPOS, UPDKZ, ZZECD
    100,  10,  00,  D,  Text1
    100,  20,  00,   ,  Text2
    100,  30,  20,  D,  Text3
    100,  40,  30,  D,  Text4
    100,  50,  00,   ,  Text5
    100,  60,  00,   D, Text6
    100,  70,  60,   D, Text7</b>
    After we run first point we will get data as:
    Here logic is pick up data where <b>UPDKZ = D</b> and <b>ZZECD NE SPACE</b>.
    <b>VBELN, POSNR, UEPOS, UPDKZ, ZZECD
    100, 10, 00, D, Text1
    100, 30, 20, D, Text3
    100, 40, 30, D, Text4
    100, 60, 00, D, Text6
    100, 70, 60, D, Text7</b>
    Then we will goto second point:
    Here we need to look into <b>3</b> things totally in 2nd point:
    1. In loop Select the record which has <b>UEPOS EQ space</b>, <b>UPDKZ = D</b> and <b>POSNR</b> should not be <b>UEPOS</b> for any other record from above data from 1st point.
    <b>100, 10, 00, D, Text1</b>
    will be selected into final internal table as per this point.
    2. If for a POSNR value UEPOS NE SPACE, UPDKZ = D then goto UEPOS's POSNR in high level check there if UPDKZ = D and then wether UEPOS is ZERO (or) contains any value.
    If any value is there repeat the process till UEPOS become ZERO. Then for that final higher level item check UPDKZ value if it has value as 'D', If has then write all those records from low item to high item into final internal table.
    <b>100, 60, 00, D, Text6
    100, 70, 60, D, Text7</b>
    In above for Item 70[POSNR] we have UEPOS as 60 and UPDKZ as D. then we will goto UEPOS's POSNR, Now POSNR is 60 then check it's UEPOS it is ZERO so check UPDKZ because it is D write both items 60, 70 into final internal table.
    2. If for a POSNR value UEPOS NE SPACE, UPDKZ = D then goto UEPOS's POSNR in high level check there if UPDKZ = D and then wether UEPOS is ZERO (or) contains any value.
    If any value is there repeat the process till UEPOS become ZERO. Then for that final higher level item check UPDKZ value if it has value as 'D', If it does not have  UPDKZ as 'D' then don't write any item from low to high into final internal table.
    If we take the scenario of below rows:
    <b>100,  20,  00,   ,  Text2
    100,  30,  20,  D,  Text3
    100,  40,  30,  D,  Text4</b>
    POSNR-40 has UEPOS-30 & UPDKZ = D then UEPOS's POSNR-30 has UEPOS-20 and UPDKZ-D then UEPOS POSNR-20 has UEPOS as 00 then stop here and see UPDKZ which is ZERO so don't consider items 20,30,40 into final i.table.
    In the above chain in any record UPDKZ is not 'D' then skip the process anddon't write the records into final internal table.
    Final output will come as:
    <b>100, 10, 00, D, Text1</b>
    <b>100, 60, 00, D, Text6
    100, 70, 60, D, Text7</b>
    Thanks for all your efforts.
    Thanks,
    Deep

  • Manipulation in a internal table

    Hi,
    I have one internal table with NETWR value with other fields.
    now i have netwr values as 10,20,30,40.
    Then i should sum up NETWR value for internal table on a single hit.
    Can anybody have the solution.
    Right now i am looping at that I.Table and calculating sum of all NETWR's.
    Any other solution!
    Thanks,
    Prasad.

    Hi,
    If you want to sum up the NETWR based on some condition then you can write the code like this.
    Loop at Itab where <condition>
    COLLECT itab INTO i_final.
    Endloop.
    or
    Loop at Itab.
    if <condition>
    COLLECT itab INTO i_final.
    Endif.
    Endloop.
    OR
    If you want to sum up these NETWR based on Document number for example PO# then you need to write like this.
    Sort itab[] by order_number.
    loop at itab.
    at new order_number.
    loop at itab where order_number = itab-order_number.
    Collect itab into i_final.
    endloop.
    endat.
    endloop.
    Cheers,
    Bujji.

  • Internal table -Logic-Data manipulation

    Hi,
    I have following requirement.
    Input Internal table
    *A T1   1   3
    *A T2   4   5
    *A T3   1   2
    *B T4   1   2
    *B T5   3   6
    *B T6   1   7
    Output
    *A T1   1     3
    *A T2   4     5
    *B T6   1     7
    basically i should delete overlapping records 
    eg: since A t3 1 2 is overlapping record it should be deleted.
    report x.
    DATA: BEGIN OF ITAB OCCURS 0,
          FLD1  TYPE CHAR20,
          FLD2  type char20,
          NUM1  TYPE I,
          NUM2  TYPE I,
          END   OF ITAB.
    ITAB-FLD1 = 'A'.
    ITAB-FLD2 = 'T1'.
    ITAB-NUM1 = '1'.
    ITAB-NUM2 = '3'.
    APPEND ITAB.
    ITAB-FLD1 = 'A'.
    ITAB-FLD2 = 'T2'.
    ITAB-NUM1 = '4'.
    ITAB-NUM2 = '5'.
    APPEND ITAB.
    ITAB-FLD1 = 'A'.
    ITAB-FLD2 = 'T3'.
    ITAB-NUM1 = '1'.
    ITAB-NUM2 = '2'.
    APPEND ITAB.
    ITAB-FLD1 = 'B'.
    ITAB-FLD2 = 'T4'.
    ITAB-NUM1 = '1'.
    ITAB-NUM2 = '2'.
    APPEND ITAB.
    ITAB-FLD1 = 'B'.
    ITAB-FLD2 = 'T5'.
    ITAB-NUM1 = '3'.
    ITAB-NUM2 = '6'.
    APPEND ITAB.
    ITAB-FLD1 = 'B'.
    ITAB-FLD2 = 'T6'.
    ITAB-NUM1 = '1'.
    ITAB-NUM2 = '7'.
    APPEND ITAB.
    LOOP At ITAB.
    ENDLOOP.

    Hi Praveen,
    You have to SORT the internal table ITAB by a field of your requirement. Then DELETE adjacent entries in the internal table by comparing the field of interest.
    SORT ITAB BY NUM1 NUM2.
    DELETE ADJACENT DUPLICATES FROM ITAB COMPARING NUM1 NUM2.
    After doing this you can perform the required actions on ITAB.
    Hope this has cleared your doubt.
    Thanks & Regards,
    Ramya Shree.M.R

  • Regarding logic in manipulation of internal table

    Hi All,
    I have one internal table as below:
    <b>I_TAB</b>.
    <b>VBELN  LIKE VBAP-VBELN,
    POSNR LIKE VBAP-POSNR,
    QTY      LIKE VBAP-KWMENG,
    SUM     LIKE VBAP-KWMENG,
    </b>
    Now i have filled in this internal table from select statement
    Data is:
    100, 10, 100
    100,  10, 200
    100,  10, 300
    100, 20, 50
    100, 30, 100
    100, 30, 200
    etc.
    Now what i want is i want t calculate SUM field in above internal table based on VBELN & POSNR
    Finally data should come as
    100, 10, QTY, 600
    100, 20, QTY, 50
    100, 30, QTY, 300
    (or)
    we can update QTY with SUM of all VBELN/POSNR.
    Can anybody tell me what is the logiic!
    Thanks,
    Deep.

    Hi,
    Declare on more table as ITAB, say JTAB.
    Loop at ITAB.
    JTAB-VBELN = ITAB-VBELN.
    JTAB-POSNR = ITAB-POSNR.
    JTAB-SUM = ITAB-QTY.
    COLLECT JTAB
    endloop.
    JTAB will have ur required output, But u cant put QTY in between since, the Qunattity is Integer field u cant place 'QTY', since it is a char.
    Sreedhar
    Message was edited by:
            Sreedhar Kanchanapalli

  • MANIPULATING INTERNAL TABLE...

    Hello,
    I have a internal table I_TAB[] as follows:
    ID--VALUE---ATTRIBUTE
    P1--36--
    D
    P3--34--
    Y
    P9--32--
    J
    I want to do a mass change in the ID value of this internal table such that, all the IDs get changed
    to 'PA' as follows. I don't want to loop at the internal table, pas value to work area and then one by one from peformcne standpoint.
    ID--VALUE---ATTRIBUTE
    PA--36--
    D
    PA--34--
    Y
    PA--32--
    J
    Regards,
    Rajesh.

    You need to use work area as follows... otherwise i guess its not possible.. Do F1 on Modify and explore
    Try this...
    DATA: WA_ITAB TYPE ITAB.
    WA_ITAB-ID = 'PA'.
    MODIFY ITAB FROM WA_ITAB TRANSPORTING ID.
    Thanks,
    SKJ

  • I want to create an internal table without using header line and occurs 0?

    hi experts,
    Can anybody help me to declare an internal table without using headerline and occurs 0 options but still i have to use the functionalities that occurs 0 and header line options provide.

    Hi Saisri,
    You can use the internal table without headerline and create a header for then internal table with the same structure. We need to use the header while manipulating with the data of the internal table.
    example:
    types: begin of ty_afpo,
                 kdauf type kdauf,
                 kdpos type kdpos,
                 ltrmp   type ltrmp,
               end   of ty_afpo.
    data : t_afpo type standard table of ty_afpo,  " internal table declaration
             wa_afpo type ty_afpo.                        " work area declaration
    <after populating the data into the internal table>
    loop at t_afpo into wa_afpo.
    write:/ wa_afpo-kdauf, wa_afpo-kdpos, wa_afpo-ltrmp.
    endloop.
    This I think shall give you a basic understanding of how things work.
    <b>Reward points if this helps,</b>
    Kiran

  • Internal Table to XML

    Hallo Experts,
    I have retrived a Internal Table from FM.
    CALL FUNCTION 'SRTUTIL_CONVERT_XML_TO_TABLE'
        EXPORTING
          xdoc             = lv_xstring
    IMPORTING
    *   ERROR_TEXT       =
         data             = lt_xml
    I have manipulated the Tagnames in the Internal Table lt_xml.
    Now I want to change the internal table to xml.
    Is there any FM or a class. can anyone help me??
    Thanks
    Kind regards
    rana Waseem

    Hallo,
    Thanks for your Reply. I am trying to manipulate the xml attributes in print report. I have the data in xstring form. I have changed it to internal Table with following code.
    CALL FUNCTION 'SRTUTIL_CONVERT_XML_TO_TABLE'
        EXPORTING
          xdoc             = lv_xstring
    IMPORTING
    *   ERROR_TEXT       =
         data             = lt_xml
    After the change in the table lt_xml I am trying to have once again a xstring to give to the Print Report. I have tried it with class
    LOOP AT lt_xml INTO ls_xml.
        CALL METHOD cl_soap_xml_helper=>transform_to_xml
          EXPORTING
            tag_name          = ls_xml-tag_name
            data              = ls_xml-tag_value
            data_type         = ls_xml-tag_type
            ignore_init_value = 'X'
    *    ignore_exception  =
          CHANGING
            xml               = lv_xstring_two
    *  ENDLOOP.
    but when I try to check the XML become an error
    The XML cannot be showed, when Stylesheet XSL  is used Remove the error and try again.
    I cannot understand where is the error. Because the orignal xstring from system is shown correct. But when I create the new xstring give error .
    Thanks for your help
    kind regards
    waseem

  • Accessing Global Internal Table in Field Routine Level

    I am working on a transformation. I have created a Global Internal Table with the structure of my Source Target + extra fields not in my source target. In the start routine of the transformation I am first copying all corresponding fields from SOURCE_PACKAGE to internal table and then finally doing a lot of manipulations and modifying and appending the internal table with data now ready for populating to target.
    I want to populate the target fields at field routine level by  the data present in the Global internal table. Can you please tell me how to code here. If data was being read by SOURCE_PACKAGE, I would have read the value of SOURCE_FIELDS - (Value). But incase of value to be read from Global Internal Table, can I refer to the internal table work area directly. Thanks.
    Global Internal Table - G_ITAB
    Work Area - WA_G_ITAB
    Is the below correct ?
    Result = WA_G_ITAB-(Field Name).

    Let me understand this with an example as I am still not clear. Suppose I am loading to a DSO having 17 Key Fields say K1, K2, K3.........K17.
    And if the 3.5x logic is
    DATA : L1 LIKE COMM_STRUCTURE-amt.
      CLEAR L1 .
      IF COMM_STRUCTURE-CHK = '222'
       OR COMM_STRUCTURE-CHK = '333' .
        L1 = COMM_STRUCTURE-amt .
      ENDIF.
      RESULT = L1 .
    Can you tell me the code of the above in BI7 at field level routine now. Please note I need to take data from G_ITAB internal table and that the DSO has 17 key fields?

  • Internal table of unknown structure as a importing parameter of FM

    Hello
    I need to build FM that performs the following operations :
    1. gets the internal table of unknown structure on the input
    Its known that table has key fields of K1 , K2 , K3 and numerical fields of N1, N1.The other fields are unknown
    2. Populate fields N1, N2 with values (logic is clear and simple)
    3. Return table
    Can you please recommend me which way I should go. Some examples are very welcome
    THanks

    Hi,
    In your tables parameter enter the name of the table with out any type. This was you may be able to use it dynamically. Next create another importing parameter as table type. there you will pass the type of the table. Now if you have these information then you should be able to define a field-symbol in the FM and do the manipulation.
    Regards
    Prasenjit

  • Print data of an internal table to a printer.

    Hi,
    Requirement: The data from an excel file is the input for the program. This data is taken into an internal table using GUI_UPLOAD adn manipulated based on certain validations. The data which is validated is finally collected into an internal table.
    This data is being downloaded to the presentation server using GUI_DOWNLOAD.
    The client is asking to print the data in the internal table to the printer {SAP Scripts are generally printed}.
    Solution required for: How to print the data of an the internal table.
    Thanks in advance.
    Best Regards,
    Goutham.
    Edited by: Raghavendra Goutham on Oct 29, 2008 7:34 PM

    Try some like this way
    report zaRs.
    data: v_params type pri_params,
    start-of-selection.
      perform display_report.
    end-of-selection.
    form display_report .
      call function 'GET_PRINT_PARAMETERS'
        exporting
          immediately            = 'X'
          line_size              = 220
          release                = 'X'
          mode                   = 'CURRENT'
          no_dialog              = ' '
        importing
          out_parameters         = v_params
          valid                  = v_valid
        exceptions
          archive_info_not_found = 1
          invalid_print_params   = 2
          invalid_archive_params = 3
          others                 = 4.
      new-page print on parameters v_params no dialog.
      loop at itab.
        write :/ itab.
      endloop.
      new-page print off.
    endform. 

  • User exit name and the correct internal table/trans table

    Hello All, I need to place a billing block on Sales order if the pricing condition of any of the order items is not a contract price (checking for pricing condition ZR00 in my case)
    What is the internal table or transparent table that need to looped through to check the pricing conditions for each item in the order?
    Is "FORM USEREXIT_MOVE_FIELD_TO_VBAK" in the include MV45AFZZ right place to do so? or is it at FORM USEREXIT_SAVE_DOCUMENT in the sae include program?
    Thanking you in advance.

    Hi Syed,
    XKOMV[] is the internal table wihch contains the pricing conditions.
    And regarding the correct userexit, you need to determine the correct one, after which the XKOMV[]/TKOMVD[] are not manipulated anywhere else in the flow.
    Regards,
    Rajasekhar

  • Reg.  comparison of two types of Internal tables.

    Hi friends!
        I have a doubt while declaring a internal table. whether to declare with header line or without header line. Can all types of manipulations be done after retrieving data from DB table to the Inernal table with headerline. Which of these two is more efficient. I would like to know the clear comparison between these two types.
    regards,
    prasad

    Hi,
    Incase of declaring an Internal table with header line will make the processing looks simple as with in a loop and endloop statement your internal manipulations namely AT NEW, AT LAST, COLLECT and other similar statements will work out, but still clearing of the respective header needs to be done whenever there is exit happens to the application after successful completion. As because I have encountered errors due to failure in clearing header as in case of batch applications and BDC applications. Also as mentioned memory  management also needs to be considered.
    Incase of declaring with work area except for the internal manipulations being pointed above, for all other cases it works out effectively and also more safer way to code your application.
    Also the declaration with or without header line also accounts whenever there is a call to a function module at which if we require to receive or pass some data through TABLES option then we need to look for the specified table type being used.
    So in all it depends the process in your application where in the type of declaration accounts.
    Regards,
    Jagath.

Maybe you are looking for