Help required in reading freight price for PO item. See below code.

H All,
I have a requirement to read frieght cost for each PO item.
Please see the below code and let me know is this approach is correct or not.
* Fetch PO header details for selected criteria
  SELECT ebeln                         "Purchasing document
         bstyp
         bsart
         loekz
         lifnr                         "Vendor
         ekgrp                         "Purchasing group
         bedat                         "Document date
         knumv
    INTO TABLE t_ekko
    FROM ekko
   WHERE ebeln IN s_ebeln
     AND lifnr IN s_lifnr
     AND ekgrp IN s_ekgrp
     AND bedat IN s_bedat.
  IF sy-subrc EQ 0.
    DELETE t_ekko
     WHERE ( bstyp NE c_bstyp_f
       AND bsart NE c_bsart_nb
       AND loekz NE space ).
    SELECT knumv
           kposn
           kdatu
           kbetr
           kwert
           lifnr
      INTO TABLE t_konv
      FROM konv
       FOR ALL ENTRIES IN t_ekko
     WHERE knumv EQ t_ekko-knumv
       AND lifnr EQ t_ekko-lifnr
       AND kdatu EQ t_ekko-bedat
       AND kappl EQ c_kappl_m
       AND kschl EQ c_kschl_frc1.
*  Fetch PO item details for the retrieved purchase orders
    SELECT ebeln                       "Purchasing document
           ebelp                       "PO item
           txz01                       "Short text
           matnr                       "Material
           matkl                       "Material group
           menge                       "PO quantity
           meins                       "UOM
           netpr                       "Net price
           netwr                       "Net value
     INTO TABLE t_ekpo
     FROM ekpo
      FOR ALL ENTRIES IN t_ekko
    WHERE ebeln EQ t_ekko-ebeln
      AND matnr IN s_matnr
      AND loekz EQ space
      AND matkl IN s_matkl.
LOOP AT t_ekpo INTO fs_ekpo.
* Read header details from EKKO for each PO item
    READ TABLE t_ekko
          INTO fs_ekko
          WITH KEY ebeln = fs_ekpo-ebeln.
    IF sy-subrc EQ 0.
      MOVE:
        fs_ekpo-ebeln TO fs_poitems-ebeln,
        fs_ekpo-ebelp TO fs_poitems-ebelp,
        fs_ekko-lifnr TO fs_poitems-lifnr,
        fs_ekko-ekgrp TO fs_poitems-ekgrp,
        fs_ekko-bedat TO fs_poitems-bedat,
        fs_ekpo-txz01 TO fs_poitems-txz01,
        fs_ekpo-matnr TO fs_poitems-matnr,
        fs_ekpo-menge TO fs_poitems-menge,
        fs_ekpo-meins TO fs_poitems-meins,
        fs_ekpo-netpr TO fs_poitems-netpr,
        fs_ekpo-netwr TO fs_poitems-netwr.
* Read table KONV for fetching fieght charge
      READ TABLE t_konv
            INTO fs_konv
            WITH KEY  kposn = fs_poitems-ebelp
                      kdatu = fs_poitems-bedat
                      lifnr = fs_poitems-lifnr.
      IF sy-subrc EQ 0.
        MOVE:
          fs_konv-kwert TO fs_poitems-fri_val.
      ENDIF.                           " if sy-subrc eq 0.
Please suggest me.
Thanks,
Jwala
Edited by: Rob Burbank on Mar 12, 2009 12:09 PM
Please use code tags

Hi,
I believe the approach is good, I would have done similar.
Regards,
Gilberto Li
Edited by: Gilberto Li on Mar 12, 2009 5:13 PM

Similar Messages

  • Help required : Back to back printing for line items.......

    I have a critical requirement:
    Mulitple Handling units are to be printed, with every new handling unit to be printed on a new page and if the line items for a particular handling unit exceeds the page then it should be printed back to back.... PLease help it very urgent. points will be rewarded.....

    go to basic settings an select print mode as "D" means duplex printing..now you will get back top back printing.

  • Need help:How to realize different prices for different quantity in CCM2.0?

    Hello,
    I'm in process of establishing catalog with CCM2.0 for our company. There is a user request to realize different prices for same item when user buying different quantity. Can you help me how I can realize this?
    Thanks a lot,
    Elly

    Hi,
    Is there somebody can help me? I really need this to be addressed ASAP...
    Thanks a lot!
    Elly

  • Query to see all BP's with a special price for an item

    Hi There,
    I'm currently still learning the product and have been tasked with finding this out, so please bear with me and let me know if there is further information that is required.
    I have a customer running SAP B1 2007 who wishes to produce a report detailing all of the BP's that have a special price for an item. 
    Therefore it would ideally show the item number, all BP's who have a special price and what that price is.
    Is there a standard report that can be run for this?  Or would a query have to be defined?
    Any help would be appreciated.

    Hi,
    AFAIK, no standard report for this. But need not to worry, you just need
    SELECT ItemCode,CardCode,Price FROM OSPP ORDER BY ItemCode,CardCode
    above simple query to cater your need.
    Best Regards,
    Hendry Wijaya

  • ASL information with the latest quotation price for that item

    Hi Gurus,
    I am looking for a query to find the Item, Approved Supplier (from the ASL) and the latest quotation price for that item from the approved supplier.
    Please help !!
    Thanks in advance !!
    KM

    Dear GordonDu,
    While executing this query, am getting these errors.
    1). [Microsoft][SQL Native Client][SQL Server]Unclosed quotation mark after the character string ' as of +T0.DocDate  From OPOR T0 INNER JOIN POR1 T1 ON T1.DocEntry=T0.DocEntry  WHERE T1.ItemCode = $[$38.1.0]  ORDER BY T0.DocDate DESC FOR BROWSE '. 2). [
    2). [Microsoft][SQL Native Client][SQL Server]Incorrect syntax near '$38.1.0'. 2). [Microsoft][SQL Native Client][SQL Server]Statement 'Service Contracts' (OCTR) (s) could not be prepared.
    Please Let me make sure of my requirement once again in short.
    1)  I have created a UDF in a Purchase Oder at title level.
    2) next, i am creating a PO for 3 items.
    3)now, i want to display the 3 items doc no and Posting date of the first Puchase order of the latest price(Last price).
    thanks for your time, if you dont mind , and if you need i can also come in skype voice chat to clarrify my requirement friend.
    thanks & regards,
    Dwarak

  • How to maintain different prices for same item in different organizations

    hi all,
    We have noticed that the list price of an item at Item Validation Org level is getting defaulted when creating requisitions. We want to maintain different prices for the item for different organizations, so that the prices will be properly defaulted to requsitions depending on supplier and receiving org.
    We found one way of doing this. Using contract purchase agreement and Advanced Pricing price lists. Can anyone please let us know if there is any other way of achieving this??
    Also, I have a question regarding Advanced pricing Price Lists. I performed following steps.
    1.Set the QP: Licensed for Product profile to Purchasing
    2.Create and approve a contract purchase agreement in Oracle Purchasing
    3.Define Price Lists and Price List Lines (optional)
    4.Define sourcing rules and ASLs to automatically default source information onto requisition lines. Associate Contract to ASL.
    5. This will enable Oracle Advanced Pricing integration in the following Oracle Purchasing functionality:
    Requisition pricing
    Purchase order pricing
    But when I create requisitions, the price from price list is not getting defaulted automatically. In requisitions form, if I go to source tab and select source as a Contract Purchase Agreement, then the price from price lists is getting defaulted. Is there any way where the source for the requisition can be automatically defaulted to Contract and the price can be picked from price lists??

    Can oyu not make it an organization level item and specify the proce there instead of keeping it a master level item?
    Regards,
    Utsav.

  • Wrong unit price for sourced item in iProcurement.

    Hi all,
    We have a BPA for a category, which has been revised and approved. Now when the user is going for shopping and searching the Item Description it is showing the correct/revised unit price for the item. But when the item is added to the cart and cart is viewed the Unit Price showing is different from the first search.
    Please guys help me out on this. Also if any one can guide me to the procedure/OAF VO query which fetches the details at the shopping cart level then also it will be helpful.
    Awaiting is your response.
    Regards
    Prakash Kumar

    Hi Guys,
    One of the reason I found out from metalink(136674.1) is the 3 listed profile options for iProc should have 3 distinct line types. I am testing it now. Once done will update the results here.
    https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=PROBLEM&id=136674.1
    Thanks & Regards
    Prakash Kumar
    Edited by: prakashjnvb on Jul 25, 2011 2:30 PM

  • Cannot change unit price for selected items in iProcurement

    Hi,
    I have defined an item with "List Price".  Then, I create a PR in iProcurement for this item.
    But I cannot update the "Unit Price" of this item as the field is protected. How can I enable the field for updating? Thanks.
    (Note: If creating PR in the requisition form in Oracle Purchsing, then I can update the unit price. Why can't in iProcurement?)
    Regards
    Leo

    What's the value of POR: Allow Unit Price Update for Catalog Items?

  • How to upload price for a item in price list using DTW ?

    hi all,
    How to upload prices of all the items in price list using DTW ?
    What are templates used for it ?
    Item masters were already created.
    Jeyakanthan

    Hi
    Create two Excel templates 'Items.xls' and 'Items_Prices.xls'
    Since you have already imported items, just have the record key and item code alone in the 'Items.xls' . For example:
    RecordKey.......ItemCode
    1.......................I0001
    2.......................I0002
    In the Items_Prices template, Fill Pricelist Number fromOPLN and Price of the Item
    RecordKey....LineNum......Price
    1......................1..............350.00   (Means for Item I001, Pricelist 1 is updated with 350)
    1......................2..............300.00   (Means for Item I001, Pricelist 2 is updated with 300)
    2......................1..............550.00   (Means for Item I002, Pricelist 1 is updated with 550)
    2......................2..............600.00    (Means for Item I002, Pricelist 2 is updated with 600)
    In step 4 of DTW, Choose
    Check - Update Exisiting Object
    Uncheck - Import New Object
    This should update the pricelist alone for the items

  • Plan Price for GR item not updating from mt. master,but taking sum of GI it

    Hello
    I am using a MTS scenario with 10 strategy. The price in the production order cost analysis view for GR item is not updating with material master price, but it is updating with a sum total price of the materials for GI in the production order. The price control for header GR item is 'S' and for all GI items it is 'V'.
    How to get the price from the material master for the GR item (order header item)?
    Thanks,
    Abhi.

    Check costing variants assigned for planned and actulas in order types ( u can see costing variants in production with CO03 in control tab).
    Check the valuation variant for which priorities given like std price, average price etc.,
    Please note that while confirming the production order the GR will happened based on the strategy given in valuation variant and it will take from material master.
    I think in your valuation variant "average price" has given higher priority and average price existed in your material master.
    System won't sum up all raw material costs and put it into GR, unless otherwise any user exit given.
    regs,
    ramesh b

  • Urgent help required - linked subreport keeps asking for parameter value

    Greetings,
    I have developed a report in the Crystal Reports bundled with Visual Studio 2005. The data is obtained from a stored procedure. One of the fields in the result set is named "Id".
    I have embedded a subreport in the details row of the main report. The subreport also gets its information from a stored procedure. This stored procedure has one parameter named "OpportunityId". This field is linked to the field named "Id" above. the subreport has been set to supress blank subreports.
    In the development environment and running the executable of the application on the development machine the report works perfectly. The subreport displays as it should and all is well.
    When I deploy the report onto user machines where they have the crystal runtime installed, the report keeps asking for a parameter value for the subreport.
    I cannot get this to stop happening.
    This report is urgently required. PLEASE could someone help me out here.
    I am at my wits end.
    I have attached a zipe file containing the following:
    - the two stored procedure
    - the rpt file
    - a sample report
    - a screen showing the report having just been generated
    Thanks in advance,
    Robert Lancaster

    <p>Hi Robert,</p><p>I see your report template and stored procedures. All seems to be ok. <br /></p><p>The most important is to assign the report parameters for all linked subreports (only one in your case).</p><p> </p><p>Try this (in C#, in VB.NET the code are very similary): </p><p>ReportDocument report = new ReportDocument(@"TopFortyReport.rpt");</p><p>AssignParameters(report, paramCollection);</p><p>// and now assign parameters to all linked subreports </p><p>foreach( CrystalDecisions.CrystalReports.Engine.Section section in report.ReportDefinition.Sections)</p><p>{</p><p>    foreach (CrystalDecisions.CrystalReports.Engine.ReportObject reportObject in section.ReportObjects)<br />    {</p><p>        if (reportObject.Kind == ReportObjectKind.SubreportObject) </p><p>        {</p><p>            SubreportObject subReport = (SubreportObject)reportObject;</p><p>            ReportDocument subDocument = subReport.OpenSubreport(subReport.SubreportName);                                               AssignParameters(subDocument, paramsCollection);</p><p>        }</p><p>} </p><p> </p><p>void AssignParameters(ReportDocument report, object[] paramsCollection)</p><p>{</p><p>    int nParams = paramsCollection.Length;</p><p>    for (int iParamIndex = 0; iParamIndex < nParams; iParamIndex++)</p><p>    {</p><p>        if (report.DataDefinition.ParameterFields[iParamIndex].IsLinked())</p><p>            continue;</p><p>        report.SetParameterValue(iParamIndex, paramsCollection[iParamIndex]);</p><p>    }</p><p>}</p><p> </p><p> </p>

  • Help required in changing to str for dynamic sql

    Hi
    I am trying to make this to string for dynamic sql, this is a part of the sql which is giving problem with p_..as parameters from proc. Help me in this , iam also seeing dbms _output but stil unable to format it to required error free string.
    || ' AND ( po.abbreviationprojectopportid LIKE '
    || '%'
    || 'NVL'
    || '('
    || p_opp_code
    || ', ''NULL'')'
    || '%'
    || ' OR co.companyname LIKE '
    || '%'
    || 'NVL'
    || '('
    || p_client_name
    || ', '' NULL'')'
    || '%'
    || ' OR le.line_item_amount = NVL '
    || ' ('
    || p_booking_amt
    || ', -0.197) '
    || 'OR po.dealcurrency = NVL '
    || '('
    || p_currency
    || ',''NULL'')'
    || 'OR be.booking_entry_id LIKE '
    || '%'
    || 'NVL ('
    || p_entry_id
    || ',''NULL'')'
    || '%'
    || ' OR le.line_item_id LIKE '
    || '%'
    || 'NVL ('
    || p_line_item
    || ',''null'')'
    || '%'
    || ' OR be.ticket_num LIKE '
    || '%'
    || 'NVL ('
    || p_ticket_num
    || ',''NULL'')'
    || '%'
    || ' OR be.updatedby LIKE '
    || '%'
    || 'NVL ('
    || p_user_name
    || ',''NULL'')'
    || '%'
    || ' OR credittransaction.acct_code ='
    || 'NVL ('
    || p_gl_account
    || ','
    || '-0.197)'
    || 'OR debittransaction.acct_code ='
    || 'NVL ('
    || p_gl_account
    || ', '
    || '-0.197) '
    || 'OR credittransaction.profit_ctr_code ='
    || 'NVL ('
    || p_profit_center
    || ','
    || ' -0.197)'
    || 'OR debittransaction.profit_ctr_code ='
    || 'NVL ('
    || p_profit_center
    || ','
    || '-0.197)'
    || ' OR le.sap_posting = NVL ('
    || p_sap_posting
    || ',''$'')'
    || 'OR cmis.cmis_code = NVL ('
    || p_cmis_nominal
    || ','' -0.197)'
    || 'OR sa.sap_code = NVL ('
    || p_sap_booking_entity
    || ', -0.197)'
    || ' OR (be.booking_date BETWEEN '
    || v_booking_date_from
    || 'AND '
    || v_booking_date_to
    || ')'
    || ' )'
    || 'ORDER BY '
    || p_sort_by
    || ' '
    || p_order;

    some errors.. Try this...
    ' SELECT be.booking_date bookingdate, '
    || ' be.booking_entry_id entryid, le.line_item_id itemid,'
    || ' po.abbreviationprojectopportid opportunitycode,'
    || ' co.companyname clientname, '
    || ' le.line_item_amount bookingamount,'
    || ' be.ticket_num ticketnum, po.dealcurrency currency,'
    || ' cmis.cmis_code cmis_nominal,'
    || ' sa.sap_code sap_booking_entity,'
    || ' (SELECT full_name '
    || ' FROM iba_employee '
    || ' WHERE TO_CHAR (employeeid) = be.updatedby) updatedby,'
    || ' be.updateddate updateddate, '
    || ' (SELECT le.line_item_amount * rate '
    || ' FROM iba_currencyconversion '
    || ' WHERE tocurrencycd = '
    || 'USD'
    || ' AND currencycd = po.dealcurrency '
    || ' AND conversiondate = be.booking_date) amountusd,'
    || 'debittransaction.acct_code debitglaccount,'
    || ' credittransaction.acct_code creditglaccount,'
    || ' debittransaction.profit_ctr_code debitprofitcenter,'
    || ' credittransaction.profit_ctr_code creditprofitcenter,'
    || ' debittransaction.amt debitamount,'
    || ' credittransaction.amt creditamount'
    || ' FROM rb_booking_entry be, '
    || ' rb_line_item le, '
    || ' rb_booking_period bp,'
    || ' rb_cmis_gl_account cmisgl,'
    || ' rb_cmis_account cmis,'
    || ' iba_projectopportunity po,'
    || ' iba_company co,'
    || ' rb_sap_account sa,'
    || ' (SELECT acctr.line_item_id line_item,'
    || ' sapgl_acc.account_code acct_code,'
    || ' acctr.amount amt,'
    || ' sappr.profit_center_code profit_ctr_code'
    || ' FROM rb_account_transaction acctr,'
    || ' rb_sap_profit_center sappr,'
    || ' rb_sap_gl_account sapgl_acc'
    || ' WHERE acctr.profit_center_id = sappr.profit_center_id '
    || ' AND acctr.gl_account_id = sapgl_acc.gl_account_id '
    || ' AND acctr.transaction_type = ''D'') debittransaction,'
    || ' (SELECT acctr.line_item_id line_item,'
    || ' sapgl_acc.account_code acct_code,'
    || ' acctr.amount amt,'
    || ' sappr.profit_center_code profit_ctr_code '
    || ' FROM rb_account_transaction acctr, '
    || ' rb_sap_profit_center sappr, '
    || ' rb_sap_gl_account sapgl_acc '
    || ' WHERE acctr.profit_center_id =sappr.profit_center_id '
    || ' AND acctr.gl_account_id = sapgl_acc.gl_account_id '
    || ' AND acctr.transaction_type = ''C'') credittransaction '
    || ' WHERE po.projectopportunityid = be.projectopportunityid '
    || ' AND be.booking_entry_id = le.booking_entry_id '
    || ' AND po.companyid = co.companyid '
    || ' AND bp.booking_period_id = be.booking_period_id '
    || ' AND cmis.cmis_id = cmisgl.cmis_id '
    || ' AND le.sap_id = sa.sap_id '
    || ' AND le.cmis_id = cmis.cmis_id '
    || ' AND debittransaction.line_item(+) = le.line_item_id '
    || ' AND credittransaction.line_item(+) = le.line_item_id '
    || ' AND ( po.abbreviationprojectopportid LIKE ' || '''%' || NVL(p_opp_code,'NULL') || '%'''
    || ' OR le.line_item_id LIKE '
    || '''%'
    || NVL (
    || p_line_item
    || ,'null')
    || '%'''
    | ' OR le.line_item_amount = '
    ||NVL(|| p_booking_amt, -0.197)
    || ' OR po.dealcurrency ='
    || NVL(p_currency,'NULL')
    || ' OR be.booking_entry_id LIKE '
    || '''%'
    || NVL (p_entry_id,'NULL')
    || '%'''
    || ' OR be.ticket_num LIKE '
    || '''%'
    || NVL (p_ticket_num,'NULL')
    || '%'''
    || ' OR be.updatedby LIKE '
    || '''%'
    || NVL (p_user_name,'NULL')
    || '%'''
    || ' OR credittransaction.acct_code ='
    || NVL (p_gl_account,-0.197)
    || ' OR debittransaction.acct_code ='
    || NVL (p_gl_account,  -0.197)
    || ' OR credittransaction.profit_ctr_code ='
    || NVL (p_profit_center, -0.197)
    || ' OR debittransaction.profit_ctr_code ='
    || NVL (p_profit_center, -0.197)
    || '  OR le.sap_posting = '
    ||NVL (p_sap_posting,'$')
    || ' OR cmis.cmis_code = '
    ||NVL (p_cmis_nominal, -0.197)
    || ' OR sa.sap_code = '
    || NVL (p_sap_booking_entity, -0.197)
    || '  OR (be.booking_date BETWEEN to_date('''
    || v_booking_date_from
    || ''') AND  to_date('''
    || v_booking_date_to
    || ''')'
    || ' OR co.companyname LIKE '
    || '''%'
    || NVL(p_client_name,'NULL')
    || '%'''
    || ' )'
    || 'ORDER BY  ' || p_sort_by || ',' || p_order;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Help required in reading a file from Shared location on Network

    Hi,
    I need help in reading a file from a shared location. Can you kindly tell me the pattern for inputting the shared location path. I am using fileUtilService>Exists
    "\\Shiva\test\shared\eForms\temp.xlsx" is the actual location of the file. How should i input the location in the INPUT variable of EXISTS.

    readResource content operation will fetch documents from Adobe Repository. Unless you checkin the required file into repository, the above error will remain.
    From a shared folder, you should able to read the files using readDocument (using FileUtils) without any issues. Perhaps, the access rights prevent the execution.
    If you are running JBoss as a windows service (turnkey will create a windows service for the JBoss instance), try the following:
    Run -> services.msc -> Right click on JBoss service for Adobe LiveCycle -> Properties
    Check the value given under logon tab. The User Account mentioned there should have appropriate access to the shared folder you are attempting read.
    Nith

  • Help required in Reading smartform

    Hi Everyone,
                     Can any one please tell me if there is any function module to read a smartform and its nodes. Function module READ_FORM is there for reading the scripts. Is there any similar function module to read smartforms.
    Awaiting your response.
    Regards,
    Srinivas

    hai.
    this may help u.
    5. Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    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.
    Smartform
    you can check this link here you can see the steps and you can do it the same by looking at it..
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    SMARTFORMS STEPS.
    1. In Tcode se11 Create a structure(struct) same like the Internal table that you are going to use in your report.
    2. Create Table type(t_struct) of stracture in se11.
    3. In your program declare Internal table(Itab) type table of structure(struct).
    4. Define work area(wa) like line of internal table.
    5. Open Tcode Smartforms
    6. In form Global setting , forminterface Import parameter define Internal table(Itab) like table type of stracture(t_struct).
    7. In form Global setting , Global definitions , in Global data define Work area(wa) like type stracture(struct).
    8. In form pages and window, create Page node by default Page1 is available.
    9. In page node you can create numbers of secondary window. But in form there is only one Main window.
    10. By right click on page you can create windows or Go to Edit, Node, Create.
    11. After creating the window right click on window create table for displaying the data that you are passing through internal table.
    12. In the table Data parameter, loop internal internal table (Itab) into work area(wa).
    13. In table there are three areas Header, Main Area, Footer.
    14. Right click on the Main area create table line by default line type1 is there select it.
    15. Divide line into cells according to your need then for each cell create Text node.
    16. In text node general attribute. Write down fields of your work area(wa) or write any thing you want to display.
    17. Save form and activate it.
    18. Then go to Environment, function module name, there you get the name of function module copy it.
    19. In your program call the function module that you have copied from your form.
    20. In your program in exporting parameter of function pass the internal table(itab).
    SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.
    SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can
    configure forms with data from an SAP System for the relevant business processes.
    To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
    You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
    You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
    SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
    SAP Smart Forms also support postage optimizing.
    Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
    What Transaction to start SAP Smart Forms?
    Execute transaction SMARTFORMS to start SAP Smart Forms.
    Key Benefits of SAP Smart Forms:
    SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time.
    You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.
    To make changes, use Drag & Drop, Copy & Paste, and select different attributes.
    These actions do not include writing of coding lines or using a Script language.
    Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one.
    For Web publishing, the system provides a generated XML output of the processed form.
    Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.
    SmartForms System Fields
    Within a form you can use the field string SFSY with its system fields. During form processing the system replaces these fields with the corresponding values. The field values come from the SAP System or are results of the processing.
    System fields of Smart Forms
    &SFSY-DATE&
    Displays the date. You determine the display format in the user master record.
    &SFSY-TIME&
    Displays the time of day in the form HH:MM:SS.
    &SFSY-PAGE&
    Inserts the number of the current print page into the text. You determine the format of the page number (for example, Arabic, numeric) in the page node.
    &SFSY-FORMPAGES&
    Displays the total number of pages for the currently processed form. This allows you to include texts such as'Page x of y' into your output.
    &SFSY-JOBPAGES&
    Contains the total page number of all forms in the currently processed print request.
    &SFSY-WINDOWNAME&
    Contains the name of the current window (string in the Window field)
    &SFSY-PAGENAME&
    Contains the name of the current page (string in the Page field)
    &SFSY-PAGEBREAK&
    Is set to 'X' after a page break (either automatic [Page 7] or command-controlled [Page 46])
    &SFSY-MAINEND&
    Is set as soon as processing of the main window on the current page ends
    &SFSY-EXCEPTION&
    Contains the name of the raised exception. You must trigger your own exceptions, which you defined in the form interface, using the user_exception macro (syntax: user_exception <exception name >).
    Example Forms Available in Standard SAP R/3
    SF_EXAMPLE_01
    Simple example; invoice with table output of flight booking for one customer
    SF_EXAMPLE_02
    Similar to SF_EXAMPLE_01 but with subtotals
    SF_EXAMPLE_03
    Similar to SF_EXAMPLE_02, whereby several customers are selected in the application program; the form is called for each customer and all form outputs are included in an output request
    Advantages of SAP Smart Forms
    SAP Smart Forms have the following advantages:
    1. The adaption of forms is supported to a large extent by graphic tools for layout and logic, so that no programming knowledge is necessary (at least 90% of all adjustments). Therefore, power user forms can also make configurations for your business processes with data from an SAP system. Consultants are only required in special cases.
    2. Displaying table structures (dynamic framing of texts)
    3. Output of background graphics, for form design in particular the use of templates which were scanned.
    4. Colored output of texts
    5. User-friendly and integrated Form Painter for the graphical design of forms
    6. Graphical Table Painter for drawing tables
    7. Reusing Font and paragraph formats in forms (Smart Styles)
    8. Data interface in XML format (XML for Smart Forms, in short XSF)
    9. Form translation is supported by standard translation tools
    10. Flexible reuse of text modules
    11. HTML output of forms (Basis release 6.10)
    12. Interactive Web forms with input fields, pushbuttons, radio buttons, etc. (Basis-Release 6.10)
    regards.
    sowjanya.b.

  • Help required: class assignment and values for functional location

    Hi All,
    My requirement is to get classification data for a functional location as in IL03.
    Can any one let me know where in the standard program are they getting the assigned classes
    and class values. So that I can use the same logic.
    Thanks.

    FM BAPI_OBJCL_GETDETAIL
    OBJECTKEY                       ?0100000000000011643
    OBJECTTABLE                     IFLOT              
    CLASSNUM                        ZPMI_BLDG          
    CLASSTYPE                       003                
    KEYDATE                         29.07.2009         
    UNVALUATED_CHARS                                   
    LANGUAGE                        EN                 
    Cheers!

Maybe you are looking for

  • Item category B and Z in Purchase order

    Hi, We have two cases: Case 1. PO type is Framework PO, item category B, account assignment K. There is one line item in PO.We are able to make inbound delivery for that PO. Case 2. For one line item PO type is Framework PO, item category B, account

  • ASA Read only User

    Hello Everyone, Can someon tell me the command for createing a user on an ASA 5500 running 7.2(3) that can only view the config but not make any changes? Thanks in advance! All replies rated

  • IMac connected to a Windows 2003 Server: Authentication Issue

    Hi. I was wondering if anyone in the community might have found a solution for this problem or could offer suggestions. In our in-house corporate graphics department we are connecting three recently purchased iMacs to a Windows Server 2003 file serve

  • Installing sap 4.7

    I'm trying to install sap 4.7 but, after prompt for the database password 'xxxadm' it throws an error. I have previously installed oracle server and client 9.2.0.1 with patch 9.2.0.2. This is the log file INFO 2007-09-22 11:05:00 Processing of host o

  • Cannot Download or Install Muse

    I have a Creative Cloud membership and I have tried to download Muse thru the Applications Manager and all it does is say downloading and the bar never changes..have waited for hours and there is no progress bar. In fact, the AAM won't even update cu