Use internal table in Smartform

Hi All,
I want to use the internal table in program in smartform.
For that i have declare that table in TABLES attribute of the function module and trying to declare that table in form interface in smartform.I have created one stucture in data dictionary of same type for the associated type of that table.But it showing me error that only table types can be used as reference type for a table parameter.
Can anybody give me the solution or atleast tell me what is problem?
Thanks.

Hi,
First you define an internal table in your Driver program and populate the same with the data and put it in the Export parameters.
Then, in your Smartform, in the Form interface parameter's declarations, specify the name which you gave in the Driver program ( the Left hand side name in the interface list of the Function Module ) and specify it as type of the internal table you have used in the Driver program.
Please define in the same way as mentioned and let me know how it worked for you or still any issues on this.
Thanks,
Vishnu.

Similar Messages

  • How to call Subroutines,Standard Text  & using Internal Table in SmartForm

    Hi all,
    need help in the following areas.Its very urgent!
    1.How to CAll Subroutines in Smart Forms
    2.How to CAll Standard Text in Smart Forms
    Situation:
    We have an Internal Table T_SALES with all the data which am going to display in the smartform,How to retrive data from an internal table in Smart forms
    Any Help in this direction would be highly appreciated.
    Regards
    Ramu

    Hi,
      When you are using quantity or currency fields, you have to mentiong the reference fileds in a tab called CURRENCY/QUANTITY FILEDS in the GLOBAL DATA node.
    Specifying a Currency or Quantity Reference
    Use
    In the ABAP Dictionary, you can assign a currency or quantity field to a table field. In the output of these fields, the system can then insert the relevant currency or unit:
    ·        If the value field is in the same table as the corresponding currency or quantity field, the system recognizes the reference automatically, and formats the value field according to the currency or unit in the assigned field.
    ·        If the value field is in a different table from the currency or quantity field, the system cannot recognize this reference automatically.
    In the second case, you must indicate this reference to the system in the form, to ensure that the value field is formatted correctly.
    Procedure
    You want to assign a currency or quantity field in one table (for example, CURTAB) to a value field in another table (for example, VALTAB).
           1.      Create the reference to the currency field by entering the following values:
    -         Field Name: VALTAB-VALUE, if this is the value field of VALTAB that you want to display.
    -         Reference Field: CURTAB-CURRENCY, which is the currency field of CURTAB.
           2.      Under Data Type, specify whether the data type is a currency or quantity.
    Result
    In the output of the PDF-based print form, the system formats the value field VALTAB-VALUE according to the assigned value in the currency or quantity field of the global variable CURTAB-CURRENCY.
    Thanks and Regards,
    Bharat Kumar Reddy.V
    Message was Added by: Bharat Reddy V
    Message was Added by: Bharat Reddy V

  • Issue in display format of internal table in smartform

    I m printing an internal table in smartform.when a particular field exceeds the coloumn's length.the rest of the texts come down to the next line.It can be shown in the below example.i m printing "+ text to be printed" in that particular coloumn.
    Because of the size of the coloumn in table ,"ed." comes down as shown.
    <b>+ text to be print
    ed. </b>
    its coming by default.
    I want it like  <b>+ text to be print
    ed</b>
    I dont want ed to come directly down '+'.I want it to start from where 't' of 'text'
    starts in the above line.
    Notice that the requirement is to print "ed" after '2' spaces.And we can not use the string length concept bcoz not of characters after which the line comes down is not fixed.May be some change of setting in smartform will do the trick.
    Please suggest what i need to do to get the desired result...
    Regards
    Rudra

    Unfortunately there is no such way.

  • Declaring an internal table in smartform

    hi,
       can anyone tell how to declare   internal table in smartform.
       the internal table contains fields from 2 or more data dictionary tables(eg.kna1 
       and adrc). after this from the print program(internal table containing data in print
       program) internal table should be passed to the smartform.
    thanks.

    hi laxya,
    if u want to pass the data from internal table in print program to Smartform.. there is only way.. that is using form interface..
    1. goto se11, create a structure same as the itab in the print program.ex. <b>z_itab</b>
    2. create line type... se11>select radio button-DATA type><b>z_it_itab</b> >press create>then select>TABLE Type> then entrer some text--> in the line type Field in giveth Str name u have created in STEP 1. activate it.
    3. got SMARTFORMS-> form inteface>tables tabe--> give some name ex <b>IT_tab type z_it_itab</b>.
    then acivate it.. then in the driver progam pass this table data.
    Exapmpel
    CALL FUNCTION fp_v_fm_name
        EXPORTING
          archive_index      = toa_dara
          archive_parameters = arc_params
          control_parameters = fp_st_control_parameters
          user_settings      = space
          output_options     = fp_st_output_options
          wa_vbdkr           = fp_st_vbdkr
        IMPORTING
          job_output_info    = l_it_ssfcrescl
          job_output_options = l_it_ssfcresop
        TABLES
    <b>      IT_tab  = z_it_itab (or table in driver program)</b>
      EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Another way is cteate a type in Globaldifination-->types tab..
    ex:
    types: begin of ty_itab,
       matnr type matnr,
       meins type meins
       vrkme  type vrkme,
    end of ty_itab,
    ty_it_itab type standard table of ty_itab.
    then GLOBAL DIFINATION>GLOBAL DATA TAB>IT)ITAB TYPE TY_IT_ITAB.
    BUT In this u can't pass the data from the print Program.. if u want to populate data in to this table... u have to write the Select query in the GLOBAL DIFINATIONS-->INITILIZATIONS TAB.
    Please Close this thread.. when u r problem is solved
    Reward if Helpful
    Regards
    Naresh Reddy K
    Message was edited by:
            Naresh Reddy

  • How to Define Internal Table in Smartform

    Hello,
    I have some problem on define Internal Table in Smartform
    I define a Temp_IT_Gen Type LBBIL_IT_GEN in Global Definiations
    but i find that it is not available for me to append data into it,
    the error message is Temp_IT_Gen is not a Internal Table - the Occurs n Specification is missing
    so how can i solve it?
    i want to use the internal table in the hold program.
    Thanks a lot in advance.

    Hi,
    First U define the Table type in 'TYPES' tab of Global Definitions and then assing that table type to Internal table in 'Global Data' tab.
    Eg:
    define the Table Type like below in TYPES tab.
    TYPES:BEGIN OF ty_TEMP.
            INCLUDE STRUCTURE XXXXXXX.
    TYPES:END OF ty_TEMP.
    TYPES: g_t_temp TYPE STANDARD TABLE OF ty_TEMP .
    Now, define the Internal table in Global Data tab like below:
    Variable Name    Type assignment    Associated Type
    G_T_ITEM_1       TYPE                    G_T_TEMP
    NOTE: whatever U define in Global Definitions can be used only in SMARTFORM, if u want to use it in Program U must define in Form Interface.
    Hope it helps!!
    Rgds,
    Pavan

  • Passing internal tables into smartforms

    Hi All,
    I am testing a smartform for PO. But the smartform is already designed and it has two internal tables of type EKKO and EKPO. When i run the smartform its displaying the layout correctly but with no data ,which is true as the two internal tables have no data. So i want to fill those two internal tables based on the purchase order number/ numbers. So that i can test the smartform with those purchase order numbers.
    I want to create a parameter / select option in smartform so that when we enter the PO number those internal tables will be filled. How to create those options in the smartform.
    If i have to create through an ABAP program then i want to know how to pass those two internal tables to smartform. (Shall i have to call the FM couple of times and then pass those two internal tables).
    Thanks in Advance

    You fill the tables in the print program and pass the tables to the SmartForm function module under the tables section.  See the FM call below (CALL FUNCTION lf_fm_name)  and note that I am only passing in one internal table.  If you wish you may pass in more than one table.
    *&      Form  smartform_print
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM smartform_print .
      DATA: lf_fm_name            TYPE rs38l_fnam.
      DATA: ls_control_param      TYPE ssfctrlop.
      DATA: ls_composer_param     TYPE ssfcompop.
      DATA: ls_recipient          TYPE swotobjid.
      DATA: ls_sender             TYPE swotobjid.
      DATA: lf_formname           TYPE tdsfname.
      DATA: ls_addr_key           LIKE addr_key.
      PERFORM set_print_param USING      ls_addr_key
                                CHANGING ls_control_param
                                         ls_composer_param
                                         ls_recipient
                                         ls_sender
                                         retcode.
    *Get the Smart Form name.
      IF NOT tnapr-sform IS INITIAL.
        lf_formname = tnapr-sform.
      ELSE.
        MESSAGE e001(/smb40/ssfcomposer).
      ENDIF.
      IF vbdkr-vkorg = '0035'.
        IF w_regio = 'QC'.
          tnapr-fonam = 'ZPCC_INVOICE_FR'.
        ENDIF.
      ENDIF.
    *  IF NOT tnapr-sform IS INITIAL.
    *    lf_formname = tnapr-sform.
    *  ELSE.
    *    MESSAGE e001(/smb40/ssfcomposer).
    *  ENDIF.
    * determine smartform function module for invoice
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
           EXPORTING  formname           = lf_formname
    *                 variant            = ' '
    *                 direct_call        = ' '
           IMPORTING  fm_name            = lf_fm_name
           EXCEPTIONS no_form            = 1
                      no_function_module = 2
                      OTHERS             = 3.
      IF sy-subrc <> 0.
    *   error handling
        retcode = sy-subrc.
        IF sy-subrc = 1.
          MESSAGE e001(/smb40/ssfcomposer).
        ENDIF.
        IF sy-subrc = 2.
          MESSAGE e002(/smb40/ssfcomposer).
        ENDIF.
        PERFORM protocol_update.
      ENDIF.
      CALL FUNCTION lf_fm_name
        EXPORTING
           archive_index              = toa_dara
    *   ARCHIVE_INDEX_TAB          =
           archive_parameters         = arc_params
           control_parameters         = ls_control_param
    *   MAIL_APPL_OBJ              =
           mail_recipient             = ls_recipient
           mail_sender                = ls_sender
           output_options             = ls_composer_param
           user_settings              = ' '
           vbdkr                      = vbdkr
           temp_jmval                 = temp_jmval
           temp_agval                 = temp_agval
           w_ship                     = w_ship
           w_ktgrd                    = w_ktgrd
           likp                       = likp
           w_trlrnbr                  = w_trlrnbr
           w_sealnbr                  = w_sealnbr
           w_booknbr                  = w_booknbr
           w_lc                       = w_lc
           w_shippoint                = w_shippoint
           billto_fedid               = billto_fedid
           soldto_fedid               = soldto_fedid
           shipto_fedid               = shipto_fedid
           vbco3                      = vbco3
           w_z4_address               = w_z4_address
           w_stawn                    = w_stawn
           w_herkl                    = w_herkl
           new_rate                   = new_rate
           vblkp                      = vblkp
          TABLES
           vbdpr                      = tvbdpr
    *       t_containers               = t_containers
    *       tdomvd                     = tkomvd
    *       da_xfplt                   = da_xfplt
    *       payment_split              = payment_split
    *       komk                       = komk
    *       frt_conditions             = frt_conditions
    * IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
    *   JOB_OUTPUT_INFO            =
    *   JOB_OUTPUT_OPTIONS         =
    EXCEPTIONS
    formatting_error           = 1
    internal_error             = 2
    send_error                 = 3
    user_canceled              = 4
    OTHERS                     = 5
      IF sy-subrc <> 0.
        retcode = sy-subrc.
        PERFORM protocol_update.
    * get SmartForm protocoll and store it in the NAST protocoll
        PERFORM add_smfrm_prot.
      ENDIF.
    ENDFORM.                    " smartform_print
    Davis

  • Issue in display format of a internal table in SMARTFORM

    I m printing an internal table in smartform.when a particular field exceeds the coloumn's length.the rest of the texts come down to the next line.It can be shown in the below example.i m printing "+ text to be printed" in that particular coloumn.
    Because of the size of the coloumn in table ,"ed." comes down as shown.
    +  text to be print
    ed.
    I dont want ed to come directly down '+'.I want it to start from where 't' of 'text'
    starts in the above line.
    Notice that the requirement is to print "ed"  after '4' spaces.
    Please suggest what i need to do to get the desired result...
    Regards
    Rudra

    Unfortunately there is no such way.

  • Abap Logic for performance tuning not working when using Internal tables

    Hi,
    I wrote this piece of code that is working correctly that is select SUM of cost from DSO where Plant is the same for Sales Items.
    LOOP AT RESULT_PACKAGE INTO rp.
    SELECT SUM( /N/S_STRDCOST ) FROM /N/ADSP_DPIT00 INTO
    rp-/N/S_STRDCOST
    WHERE /N42/S_SALESITEM = rp-/N42/S_ITEMID AND /N42/S_PLPLANT EQ
    rp-/N42/S_SOURCE.
    MODIFY RESULT_PACKAGE FROM rp.
    Clear rp.
    ENDLOOP.
    Now I try to rewrite it for performance tunning using internal table  but I am getting 0 values. can't figure out whats the problem and been struggling fixing it.
    TYPES : begin of ty_DSO_TABLE,
             /N42/S_STRDCOST TYPE /N/ADSP_DSPC00-/N/S_STRDCOST,
             /N42/S_ITEMID TYPE /N/ADSP_DSPC00-/N/S_ITEMID,
           end of ty_DSO_TABLE.
    DATA: it_DSO_TABLE type hashed table of ty_DSO_TABLE with unique key
    /N/S_ITEMID,
         wa_DSO_TABLE type ty_DSO_TABLE.
    Field-symbols:  <rp> TYPE tys_TG_1.
    LOOP AT RESULT_PACKAGE assigning <rp>.
      clear wa_DSO_TABLE.
    Read table IT_DSO_TABLE into wa_DSO_TABLE with table key /N/S_ITEMID
      = <rp>-/N/S_ITEMID.
      if sy-subrc ne 0.
          select SUM( /N/S_STRDCOST )  into CORRESPONDING
          FIELDS OF wa_DSO_TABLE from
          /N/ADSP_DPIT00 WHERE /N/S_SALESITEM =  <rp>-/N/S_ITEMID AND
          /N/S_PLPLANT EQ <rp>-/N/S_SOURCE.
         if sy-subrc eq 0.
              <rp>-/N/S_STRDCOST = wa_DSO_TABLE-/N/S_STRDCOST.
         endif.
    endif.
    ENDLOOP.
    Any idea whats wrong with the code
    thanks

    Hi Vaidya,
    According to the code which you have written, there is no value in table IT_DSO_TABLE when you are trying to read the values.And after the read statement you have given a condition for sy-subrc. Hence the select statement is actually not even getting executed. *Also you have not assigned the final value back to the ResultPackage.*_
    So Kindly correct your code as follows:
    Data: wa_dso type ty_DSO_TABLE.
    LOOP AT RESULT_PACKAGE assigning <rp>.
    clear wa_DSO_TABLE.
    select SUM( /N/S_STRDCOST ) into CORRESPONDING
    FIELDS OF wa_DSO_TABLE from
    /N/ADSP_DPIT00 WHERE /N/S_SALESITEM = <rp>-/N/S_ITEMID AND
    /N/S_PLPLANT EQ <rp>-/N/S_SOURCE.
    if sy-subrc eq 0.
    <rp>-/N/S_STRDCOST = wa_DSO_TABLE-/N/S_STRDCOST.
    MODIFY RESULT_PACKAGE FROM <rp>.
    endif.
    ENDLOOP.
    Hope this helps you.
    Regards,
    Satyam

  • Using internal tables in BI 7 Start routines

    Hi All
    I tried searching for using internal tables in a start routine in BI 7 could not find the right pointers.
    This is what I am trying to do is the following:
    In a DSO ZSD_O01  I have a sales order and sales order item number and this DSO also contains the Contract number and the contract Item number.
    The DSO structure is as follows:
    /BIC/AZSD_O0100
    DOC_NUMBER
    ITEM
    CONTRACT
    CITEMNUM
    I want to read the data in this DSO into a internal table. But the key fields in this DSO is DOC_NUMBER and ITEM so I want to read this data into a internal table only for the first data package into the internal table. Thereafter I want to lookup into the internal table given the doc_number and ITEM to find the CONTRACT and CITEMNUM.
    Can any of you kindly show me how to :
    - Read data from a DSO into a internal table
    - Read the internal table for the first data package
    - How do I make the access in the internal table fast when my lookup in the internal table is not on the
      DSO key columns but on a different key column
    Appreciate your help
    Thanks
    Karen

    Hi Karen ,
    It will be helpful if you tell your requirement  as the approach you suggested is not looks convincing .May be their is some easy way and we can suggest you better approach
    -how to check for source_package = 1
    You need to hard code it .
    We decide package size at DTP level so you can declare a global variable .let say you have 50000 size of your  package then use global variable as counter and read only when record_count is <= 50000 .
    -how to declare the internal table so the values in it exists between different data packages
    Declare a global table and select data into it .A global table retain data across  the packages .
    - The key on which I need to lookup in the internal table is not the key fields as in the DSO
    Its ok .Let say you are doing lookup on A B and C field of DSO1 and the values may duplicate  in your source .then you just need to read the internal table having data from DSO2  with key field  A B C .
    Better if you set them as semantic keys at DTP level so that all  duplicate entries of A B  C will appear in same package .
    global Declarations
    In your start routine you will have this following code :
      TYPES:
          tyt_SC_1        TYPE STANDARD TABLE OF tys_SC_1
                            WITH NON-UNIQUE DEFAULT KEY.
    $$ begin of global - insert your declaration only below this line  -
    ...   insert your code here
    $$ end of global - insert your declaration only before this line   -
    One question
    Why you want to populate values for 1 source package only not for all ?This will be helpful to understand your requirement and may be we can fulfill it in some other manner .
    Regards,
    Jaya Tiwari

  • Report using internal table events

    Hi,
    i have an internal table with  the fields 1. profitcenter 2. company code 3. gl account 4. amount
    for each profit center i need to seggregate accounts based on company code.
    the report should look like the one below.
    please suggest some code using internal table events at new , at end etc. as im not using alv. your help will be rewarded
    regards,
    ravi.
    -Profitcenter-companycodeglaccount-amount---
    -pfcenter1----
    glaccount1-1000---
    glaccount2-2000---
    4444-total--3000---
    glaccount1-4000---
    glaccount2-1000---
    3333-total--5000---
    -profitcentre1*total8000---
    profitcentre2.........

    Hi.
    TYPES: BEGIN OF G_I_DATA,
             PROFIT(4)   TYPE C,
             COMPANY(4)  TYPE C,
             ACCOUNT(10) TYPE C,
             AMOUNT      TYPE P,
           END OF G_I_DATA.
    DATA: G_IT_DATA TYPE TABLE OF G_I_DATA,
          G_WA_DATA TYPE G_I_DATA.
    DATA: G_SUM_COMPANY  TYPE P,
          G_SUM_PROFIT   TYPE P,
          G_AMOUNT       TYPE P.
      G_WA_DATA-PROFIT = '0001'.
      G_WA_DATA-COMPANY = '1111'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
      G_WA_DATA-AMOUNT = 2000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0001'.
      G_WA_DATA-COMPANY = '1111'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
      G_WA_DATA-AMOUNT = 3000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0001'.
      G_WA_DATA-COMPANY = '2222'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
      G_WA_DATA-AMOUNT = 4000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0001'.
      G_WA_DATA-COMPANY = '2222'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
      G_WA_DATA-AMOUNT = 5000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0002'.
      G_WA_DATA-COMPANY = '1111'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
      G_WA_DATA-AMOUNT = 2000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0002'.
      G_WA_DATA-COMPANY = '1111'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
      G_WA_DATA-AMOUNT = 3000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0002'.
      G_WA_DATA-COMPANY = '2222'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT1'.
      G_WA_DATA-AMOUNT = 4000.
      APPEND G_WA_DATA TO G_IT_DATA.
      G_WA_DATA-PROFIT = '0002'.
      G_WA_DATA-COMPANY = '2222'.
      G_WA_DATA-ACCOUNT = 'ACCOUNT2'.
      G_WA_DATA-AMOUNT = 5000.
      APPEND G_WA_DATA TO G_IT_DATA.
      SORT G_IT_DATA BY PROFIT COMPANY ACCOUNT.
      WRITE: /6 'ProfitCenter', 20 'CompanyCode',
              34 'Glaccount', 48 'Amount'.
      WRITE: /6 SY-ULINE(50).
      LOOP AT G_IT_DATA INTO G_WA_DATA.
        AT NEW PROFIT.
          WRITE: /6 G_WA_DATA-PROFIT.
        ENDAT.
        G_AMOUNT = G_WA_DATA-AMOUNT.
        AT NEW ACCOUNT.
          WRITE: /34 G_WA_DATA-ACCOUNT,
                 48  G_AMOUNT.
        ENDAT.
        G_SUM_PROFIT = G_SUM_PROFIT + G_WA_DATA-AMOUNT.
        G_SUM_COMPANY = G_SUM_COMPANY + G_WA_DATA-AMOUNT.
        AT END OF COMPANY.
          WRITE: /20 G_WA_DATA-COMPANY,
                  34 'Totle',
                  48 G_SUM_COMPANY.
          CLEAR G_SUM_COMPANY.
          WRITE: /6 '*******'.
        ENDAT.
        AT END OF PROFIT.
          WRITE: /6 G_WA_DATA-PROFIT,
                  20 'Totle',
                  48 G_SUM_PROFIT.
          CLEAR G_SUM_PROFIT.
          WRITE: /6 '*************************************'.
        ENDAT.
      ENDLOOP.

  • Is there any other option for using internal table in badi

    hi
    i know we cannot use internal table in badi
    but is der any other option
    plz write in d codez too
    with Regards
    Rohan Shetty
    Edited by: Rohan Shetty on May 6, 2008 2:14 PM

    of course you can use internal table in BAdi, do like this.
    data: itab type table of ....
    data: wa type ...
    Example:
    data: itab type (standard, sorted, hashed) table of mara.
    data: wa type mara.
    Or create your own type within the badi.
    types: begin of ty_xxx,
                fielda  type c,
                fieldb  type n,
                fieldc  type d.
    types: end   of ty_xxx
    data: itab type table of ty_xxx.
    data: wa type ty_xxx.
    Edited by: Micky Oestreich on May 6, 2008 2:16 PM

  • How to Import customized internal table to smartform from Print Program

    Hi Gurus,
    I want to Import customized internal table to smartform from print program, Can anybody tell me how it is possible.
    With regards,
    S.Saravanan

    There is no problem passing an internal table to a smarforms, smartforms have the same interface as a function module ([Defining the Form Interface|http://help.sap.com/saphelp_nw70/helpdata/en/1c/f40c5bddf311d3b574006094192fe3/frameset.htm] in [Smart Forms|http://help.sap.com/saphelp_nw70/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm]) so could you elaborate a little more on your requirement (is it a standard a custom forms, etc.)
    Regards,
    Raymond

  • Selecting records from DB table with out using internal tables

    hi,
    i need to retrieve values from a database table based on few fields and date as well. however, i need to check whether the date is less or equal to the current date and along with that i should get the appropriate record. how can i do that with out using internal table.
    field1-----date---
    11111----
    20070219
    11111--20070214 <---
    11111----
    20070205
    in the above scenario i should get the second record
    Regards,
    Kranthi.

    Try:
    REPORT ztest MESSAGE-ID 00.
    TABLES bkpf.
    SELECT * FROM bkpf
      UP TO 1 ROWS
      WHERE budat <= sy-datum
      ORDER BY budat DESCENDING.
    ENDSELECT.
    Rob

  • Submititng the program to another program  using internal table values

    Hi All,
    How to Submit from one program to another program using internal table values minimum 7 int tables without using the seletion screen
    thanks
    raj

    Hi All,
    Thank you very much for your inputs.
    i am facing another issue:
    For each 10,000 records it should trigger a job  (we are trying to call a program)  were the validation will be done only through the other program.
    please find the code mentioned below :
    TABLES : but000.
    DATA:  int_bp LIKE but000 OCCURS 0 WITH HEADER LINE.
    data released like BTCH0000-CHAR1.
    DATA: jobnumber LIKE tbtcjob-jobcount, " Job ID and
          jobname LIKE tbtcjob-jobname, " job name.
          startdate LIKE tbtcjob-sdlstrtdt, " Start-time
          starttime LIKE tbtcjob-sdlstrttm, " window specs.
          laststartdate LIKE tbtcjob-laststrtdt,
          laststarttime LIKE tbtcjob-laststrttm,
          job_released LIKE btch0000-char1. " JOB_CLOSE: Was job released?
    DATA : l1 TYPE i,
           b_size TYPE i,
           b_cursor TYPE cursor.
    INITIALIZATION.
      b_size = 5000.
    START-OF-SELECTION.
      OPEN CURSOR WITH HOLD b_cursor
         FOR
         SELECT *
         FROM but000
         WHERE bpkind = 'AA'.
      IF sy-subrc = 0.
        DO.
          FETCH NEXT CURSOR b_cursor INTO TABLE int_bp
                                               PACKAGE SIZE b_size.
    Note : here in this point  we are getting a dump for the second job trigger.
          IF sy-subrc = 0.
            CLEAR jobname.
            CONCATENATE sy-repid sy-datum sy-uzeit INTO jobname.
    export int_bp to memory id 'ABC'.
            CALL FUNCTION 'JOB_OPEN'
                 EXPORTING
                      jobname          = jobname
                 IMPORTING
                      jobcount         = jobnumber.
                EXCEPTIONS
                     cant_create_job  = 1
                     invalid_job_data = 2
                     jobname_missing  = 3
                     OTHERS           = 4
    CALL FUNCTION 'JOB_SUBMIT'
          EXPORTING
               authcknam = sy-uname
               jobname   = jobname
               jobcount  = jobnumber
               report    = 'YTEST_RRR'.
               variant   = lv_variant.
       SUBMIT ytest_rrr
          VIA JOB jobname NUMBER jobnumber
          AND RETURN.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
           event_periodic                    = 'X'
            jobcount                          = jobnumber
            jobname                           = jobname
            strtimmed                         = 'X'
          IMPORTING
            job_was_released                  = released
            else.
            EXIT.
          ENDIF.
        ENDDO.
    calling program :
    REPORT YTEST_RRR .
    data itab1 like but000 occurs 0 with header line.
    data l type i.
    import itab1 from memory id 'ABC' .
    describe table itab1 lines l.
    free memory id 'ABC'.
    write:/ 'total records are:', l.
    Please give your suggestion why its going for  dump in the second iteration.
    thanks in advance.

  • Best way to declare and use internal table

    Hi all,
    As per my knoledge there are various techeniques (Methods) to declare and use the internal tables.
    Please Suggest me the Best way to declaring and using internal table ( WITH EXAMPLE ).
    Please Give the reason as well how the particular method is good ?
    What are benefits of particular method ?
    Thanks in advance.
    Regards
    Raj

    Hello Raj Ahir,
    There are so many methods to declare an internal table.
    Mainly I would like to explain 2 of them mostly used.
    1. Using Work Area and
    2. With header line.
    This with header line concept is not suggestable, because, when we shift the code to oops concept.. it doesn't work... Because OOPS doesn't support the Headerline concept...
    But it all depends on the situation.
    If you are sure that your program doen't make use of the OOPs concept, you can use HEADER LINE concept. If it invols OOPs use WORK AREA concept.
    Now I'l explain these two methods with an example each...
    1. Using Work area.
    TABLES: sflight.
    DATA: it_sflight TYPE TABLE OF sflight.
    DATA: wa_sflight LIKE LINE OF it_sflight.
    SELECT *
      FROM sflight
      INTO it_sflight
      WHERE <condition>.
      LOOP AT it_sflight INTO wa_sflight.
        WRITE / wa_sflight.
      ENDLOOP.
      In this case we have to transfer data into work area wa_sflight.
    We can't access the data from the internal table direclty without work
    area.
    *<===============================================
    2. Using Header line.
      DATA: BEGIN OF it_sflight OCCURS 0,
              carrid LIKE sflight-carrid,
              connid LIKE sflight-connid,
              fldate LIKE sflight-fldate,
            END OF it_sflight.
      SELECT *
        FROM sflight
        INTO it_sflight
        WHERE <condition>.
        LOOP AT it_sflight INTO wa_sflight.
          WRITE / wa_sflight.
        ENDLOOP.
    In this case we can directly access the data from the internal table.
    Here the internal table name represents the header. for each and every
    interation the header line will get filled with new data. If you want to
    represnent the internal table body you can use it_sflight[].
    *<======================================================
    TYPES: BEGIN OF st_sflight,
             carrid LIKE sflight-carrid,
             connid LIKE sflight-connid,
             fldate LIKE sflight-fldate,
           END OF st_sflight.
    DATA: it_sflight TYPE TABLE OF st_sflight,
          wa_sflight LIKE LINE OF it_sflight.
    This is using with work area.
    DATA: it_sflight LIKE sflight OCCURS 0 WITH HEADER LINE.
    This is using header line.
    <b>REWARD THE POINTS IF IT IS HELPFUL.</b>
    Regards
    Sasidhar Reddy Matli.
    Message was edited by: Sasidhar Reddy Matli
            Sasidhar Reddy Matli

Maybe you are looking for

  • Unable to unarchive ZIP file Error - 1

    Every time I try to archive a ZIP file, i get the message "Unable to archive (Error - 1)" How can I fix this?

  • RFC to SOAP in PI 7.0 (Import Issue)

    Hi experts I am working on an RFC to SOAP scenario, The scenario is working fine with out any issues on Development system, When we migrated into testing environment (from DID to AID) then the data which is coming into RFC from ECC is getting truncat

  • Delete ron in text file

    Hi how can i delete row form text file in java ? which class do i need to load this file delete the row and save it.

  • Tables used for material ledger

    What are the standard tables used for material ledger

  • Startup disk FULL..release what ? & HOW?

    i am occasionally getting an error message that my startup disk is getting full...i guess i need to release some items. i have been advised music on my itunes library that i very rarely access should leave. i have it backed up to dvd's. Now, all i do