Userexits and sap scripts in PP module

Can anyone give me some examples of user exits and sap scripts in PP module? I need it for my resume. I appreciate your responses.

Dear,
Principle of Dual Control provides an application the option of validating certain process flows with a principle of multiple control.
Please refer this link,
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PPPDC/PPPDC.pdf
Regards,
R.Brahmankar

Similar Messages

  • How to find out existing Reports and sap scripts and smartforms ?

    Dear Friends ,
    How to find out existing Reports and sap scripts and smartforms ?
    ( e.g: how many existing reports and SAP scripts are available in MM or SD module , What is the procedure to find out ? )
    Thanking you.
    Regards,
    Subash.

    scripts r stored in TNAPR TABLES

  • Search print program and sap script

    hii , how can i find  trigring print program and sap script  for a particular  purchase order.
            regards  Aditya
    Edited by: aditya shrivastaba on Apr 14, 2008 9:59 AM

    Hey,
    First go with Me22 or 23 with po that you had, and then check with output type for that in the transaction. After that go to TNAPR table and check the corresponding form and print program.
    Or else, go with NAST table in that put PO num in 123456 and put in OBJKY field in nast table. It will give you the output type of it, so that u can find the print program and lay out in TNAPR
    Many thanks,
    Raghu.

  • How to do changes in Layouts setting and SAP scripts to meet requirment?

    hi SD gurus,
    Please explain me how create and work with Z output .
    where and how we do changes in Layouts setting and SAP scripts to meet the user requirments.
    pls forward func spec of Z output
    points will be rewarded
    thanx & regards

    you need ABAP skills to do this.
    basically you need:
    1) draw the layout on a piece of paper
    2) define the fields you need and find out the corresponding SAP fields
    3) check the document with the customer
    4) give this specification to the developer
    5) the developer will give you a program name and form name: place them in the message for the document.
    Roberto

  • Dunning Notice print/email using both Smartform and SAP-Script

    Hello Gurus,
    I have developed the Customized SAP Sript (Copy of 150_DUNN_01) for Dunning NOtice to be send to Domestic Customer and
    Cutomized Smartform (copy of F150_DUNN_SF) for Foreign Customer.
    Now Issue is that when I assign the Customized script to SPRO setting and standrd setting for BTE '00001720' with function
    module 'FI_PRINT_DUNNING_NOTICE', if I want to assign smartform to SPRO setting then I need to replace same FM with
    'FI_PRINT_DUNNING_NOTICE_SMARTF'.
    how it is possible to work with both SAP-Script and Smartforms for dunning Procedure.
    Please gurus let me help for this solution...
    Thanks in Advance,
    Mahesh Sachani

    Hello Gurus,
    Please reply with any solution available with any...
    Thanks,
    Mahesh

  • SAP Script in Function module

    HI Experts,
    I will get VBELN as an import parameter in my Z-FM.
    Now i have to pass this VBELN to RVORDER01 script and to finally get the OTF data from CLose_form.
    How to sap script processing in function module
    Thanks
    Chandra

    Example
    Definition in the SAPscript form:
    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM
    / &BARCODE&
    Coding of the calling ABAP program:
    REPORT QCJPERFO.
    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA: PAGNUM LIKE SY-TABIX, "page number
    NEXTPAGE LIKE SY-TABIX. "number of next page
    READ TABLE IN_PAR WITH KEY u2018PAGEu2019.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY u2018NEXTPAGEu2019.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY u2018BARCODEu2019.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = u2018|u2019. "First page
    ELSE.
    OUT_PAR-VALUE = u2018||u2019. "Next page
    ENDIF.
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = u2018Lu2019. "Flag: last page
    ENDIF.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.

  • Report  and SAP-SCRIPT  &  SCREEN PAINTER

    Hi all ,
      I need some help.
    1)How to transport sap-script.
    2) print program of sap script are client-dependent or client-independent.
    3)Database tables ( on se11)  are client-dependent or client-independent. ( is sy-mandt will make dependent or independent)
    4) how to create select-option on screen painter or with module pool programming.
    5)performance tuning for ABAP report.
    points for all answers assured.
    thanks.

    Ihave some notes on transporting sapscript for earlier version of SAP. 
    The steps may vary based on your version and Suppport PAckages levels. 
    In the future your version and platform detials will help in a quicker response.
    Summary of sapscript EXPORT / IMPORT process.
    Steps to export Layout Sets (sapscript)
    Log on the Source system and client
    This may have to be client 000 and then again in the client in which you do developement.
    Note that sapscript is client dependent
    SE38 and execute program RSTXR3TR
    Tranport number: DS1K9#####
    Mode field: EXPORT
    File system: Server -  radio button
    The dataset name: /usr/sap/trans/data/DS1K9#####.layoutsets
    CHECK the Display dataset contents checkbox
    Execute
    Steps to import Layout Sets (sapscript)
    Log on the target system and client.  This may have to be client 000 and then in the client in which you test, or ultimatly production.
    SE38 and execute program RSTXR3TR
    Tranport number: DS1K9#####
    Mode field: IMPORT
    The dataset name: /usr/sap/trans/data/DS1K9#####.layoutsets
    CHECK the Display dataset contents checkbox
    Execute
    Note: when importing into Production, the export does not need to be performed. 
    Therefore only the import protion is required once the sapscript has been exported from Development.

  • How to attach print program and sap script for F150 transaction

    How to attach print program and Z sap script for F150 transaction

    Hi,
    you can find the customization for dunning in transaction SPRO under this path: Financial Accounting->Accounts Receivable and Accaounts Payable->Business Transactions->Dunning.
    Kostas

  • Email notification and SAP Script feature M0001

    Hi All,
    I have posted this questions in HCM forum but am posting again in ABAP forum since SAP script is related to ABAP development also. I will appreciate your help on this.
    I am trying to send a notification to a distribution list whenever there is a specific Action (MASSN). I have two issues while trying to do so -
    1 - I have defined the dynamic action and feature M0001 and a SAP script in SO10. I am getting the message in my inbox but with the variables from IT0000 only. In my sap script I have defined fields from IT0002/ IT0041 etc but those fields are coming as blank in my notification. Is this because I have configured dynamic action for IT0000 only. This is how my dynamic action looks like -
    0000 06 1 P **SEND IF CHANGE IN MASSN -IT0000*****
    0000 06 2 P T001P-MOLGA='10'
    0000 06 4 P P0000-MASSN='UP'
    0000 06 6 P P0000-MASSG='02'
    0000 06 8 M M0001
    Do I have to define these configurations for each and every infotype (that I have used in my SAP script) in table T588Z ?
    2 - I want to include the position text instead of the Position no. in my notification. How can I do that? Since position text is stored in T582 table and not in P0000 or P0001.
    Thank you for reading and I will appreciate your suggestions.
    Sanghamitra

    Hi Kjetil,
    Do you know how the problem was finally solved in your former company?
    I already had a look to your post before, but for me the question is still opened. We have a corporate (non SAP) portal which users see by default when they open their browser and from where they can navigate to the SAP portal, in which we do not have single sign on.
    So our users will definitely not login to the SAP Portal by themselves (nor to go to UWL, nor to display the homepage).
    Maybe that an applet running on the corporate portal and doing RFC calls on the different back-ends would solve it, but I believe that might be quite a burden to develop, especially if we start talking to various non SAP systems as well. A better approach would probably be to query the portal db to look at what is in each user's UWL. But I have no idea of how the UWL data is structured in the portal and how it is updated (i.e. is the delta pull mechanism also running when a user is not logged in the portal?). I am also not sure whether there is an API in the portal to query this easily (i.e. similar to SAP_WAPI_COUT_WORKITEMS). Has anyone tried this approach before?
    Cheers,
    Patrick

  • Link between pe51 and SAP script

    I have a requirement for check printing along with remuneration statement.
    I have copied the standard sap script f110_prenum_chck into z110_prenum_chck
    I am using the standard driver program RFFOUS_C.
    My requirement is: Remuneration statement from PE51 should be printed in the top portion of the page and check should be printed in the middle portion. For Remuneration part, I have kept Main Window in position in the script with the element 525-HR as the only active element.
    For check portion, everything is working fine as i have customized it accordingly. For remuneration statement Funct. ppl have copied some standard version in PE51 to Z say ZXXX.
    but remuneration statement is not getting printed.
    How do i trigger ZXXX into z110_prenum_chck without changing the standard program??

    Hi Babu,
    I never came across this senerio so i have no idea but as per your req i think abaper may help you so kindly contact abap consultant.
    Thanks

  • Steps to develop smartforms and sap scripts

    hi experts,
    I want to learn smartforms and sapscripts from the scratch step by step. i have gone through few threads, but iam not clear with the declarations.
    thanks in advance
    maaya

    Maaya,
    Go thru these links...
    SAPScripts
    Link for SAP Scripts (step by step procedure)
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Create_A_SAPSCRIPT_Form/How_to_Create_SAPSCRIPT.html
    http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
    http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
    http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
    http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
    http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
    http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
    SAP SCRIPT FIELDS
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm
    scripts easy material
    http://www.allsaplinks.com/sap_script_made_easy.html
    for Smartforms material
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapgenie.com/abap/smartforms.htm
    How to trace smartform
    http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    check most imp link
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    step by step good ex link is....
    http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
    Subtotals - Check the link...
    Re: Subtotal with Table Node in smartforms
    Smarforms
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    Re: Need FAQ's
    SmartForms : some links
    http://www.sapgenie.com/abap/smartforms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://help.sap.com/saphelp_46c/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/Data/htm/english.htm
    http://www.sap-img.com/smartforms/smart-001.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sap-img.com/smartforms/smart-002.htm
    http://www.sapgenie.com/abap/smartforms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    http://www.sapgenie.com/abap/smartforms.htm
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-img.com/smartforms/smartform-tutorial.htm
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/SMARTFORMS_tutorial.html
    http://www.allsaplinks.com/smartform_example.html
    http://www.sap-basis-abap.com/sapsf001.htm
    Smart Form PDF Link
    http://help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
    http://sap.ionelburlacu.ro/sap0/sapsf001.htm
    http://help.sap.com/saphelp_erp2004/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/a5/de6838abce021ae10000009b38f842/content.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/16/a369b1800e4bdda978ee0fe3b7bd2c/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/a5/de6838abce021ae10000009b38f842/content.htm
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-img.com/smartforms/smart-001.htm
    Re: How to Debug a Smartform
    Debug of smartform and sapscript.
    Debugging SmartForms
    Debugging of a subroutine pool.
    http://help.sap.com/saphelp_erp2004/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
    SRIPTS
    http://wiki.ittoolbox.com/index.php/Sap_script#7.6.7.09Space_Compression
    SCRIPT OUTPUT TO PDF
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49e15474-0e01-0010-9cba-e62df8244556
    Reward if helpful,
    Karthik

  • Output documents and SAP Scripts

    We have an ever increasing problem with Sap Scripts and driver programs for Output Documents. There is a lot of hard coded stuff in the driver programs based on output type.
    I
    If nast-kschl = 'XX'
    Do something
    elseif nast-kschl = 'YY'
    Do something else
    Endif
    This is causing a lot of maintainance problems. Logically, such conditional behavior is required. We need to execute different logic for different output types. Similarly there are hard coded conditions based on parameters.
    for e.g.
    select * from knvk where kunnr = hardcoded and abtnr = hardcoded
    The problem is that all this custom hard coded logic is dispersed through out the program and it becomes difficult to maintain them.
    I was wondering how folks on SDN have tackled this problem at your various clients.

    S Kumar -
    I think you may have misunderstood my original question.
    Consider this scnerio:
    If nast-kschl = 'XX'
         var1 = A
         var2 = B
    elseif nast-kschl = 'YY'
         var1 = C
         var2 = D
    Endif
    This is a simplified version of what the problem is. There are many output types and many different business logic that are conditionally applied. This is creating havoc in my driver programs. Plus these are 10 year old driver programs. They have been maintained over and over again and numerous changes have taken place.
    We would not want to face a similar issue for our next implemention and am wondering what the best solution to this problem would be. Going Smartforms? Would that help?

  • SAP Script- MR90(Finance Module)

    Hi,
    I have configured an new output type for ( Finance ) Redemption Claim Invoice SAP Script in SPRO.
    But in the MR90. for executing the new layout with output type i am not able to create the data.
    In MIRO I tried creating the INVOICE but i could not create the invoice to the new output message type.
    Can anyone please guide me how to proceed with.
    THANKS IN ADVANCE.
    GUHAPRIYAN SUBRAHMANYAM.

    Example
    Definition in the SAPscript form:
    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM
    / &BARCODE&
    Coding of the calling ABAP program:
    REPORT QCJPERFO.
    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA: PAGNUM LIKE SY-TABIX, "page number
    NEXTPAGE LIKE SY-TABIX. "number of next page
    READ TABLE IN_PAR WITH KEY u2018PAGEu2019.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY u2018NEXTPAGEu2019.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY u2018BARCODEu2019.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = u2018|u2019. "First page
    ELSE.
    OUT_PAR-VALUE = u2018||u2019. "Next page
    ENDIF.
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = u2018Lu2019. "Flag: last page
    ENDIF.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.

  • Query related to alv grid and sap script

    Hi All,
    I have a requirement where i should read the values which are selected on the alv grid list output and those values i need to display on the script(layout).
    Help me out guru's its an urgency...
    thanks in advance .
    regards
    ravi ganji

    Hi Ravi,
    I have done it exactly like your requirement. This program contains ALV and Smartform.
    But whatever may be, both are layouts and having driver program. So just finish your driver program and Script layout and then use this program.
    I have written this code to print contact letters from VA42. So, modify this code to insert your transaction code.
    Let me know if you have any questions.
    Here is the code.
    REPORT ILETTER MESSAGE-ID CM.
    TYPE POOLS (ALV)
      TYPE-POOLS:
                slis.
    Customized Types
      TYPES:
            BEGIN OF ty_cntrt,
              box(1)   TYPE c,
              kunnr    TYPE kunag,
              vbeln    TYPE vbeln_va,
              vbeln1   TYPE vbeln_va,
              vposn    TYPE posnr,
              vuntdat  TYPE vudat_veda,
              vbegdat  TYPE vbdat_veda,
              vdemdat  TYPE vddat_veda,
              venddat  TYPE vndat_veda,
            END   OF ty_cntrt,
          single line TYPES
            BEGIN OF ty_vkorg,
             vkorg    TYPE vkorg,
            END   OF ty_vkorg.
    Constants
      CONSTANTS:
         c_sform  TYPE char10             VALUE 'SMARTFORMS',
         c_tcode  TYPE sy-tcode           VALUE 'VA42',
         c_mode   TYPE c                  VALUE 'N',
         c_updat  TYPE c                  VALUE 'A',
         c_batch  TYPE sy-callr           VALUE 'BATCH',
         c_dclick TYPE char10             VALUE '&IC1'.
    Internal tables
      DATA: it_cntrt TYPE TABLE OF ty_cntrt,
            it_bdc   TYPE TABLE OF bdcdata,
            it_mesg  TYPE TABLE OF bdcmsgcoll,
            it_const TYPE TABLE OF /SIE/SSG_XCM_CUC,
            it_vkorg TYPE TABLE OF ty_vkorg.
    Work areas
      DATA: wa_cntrt TYPE ty_cntrt,
            wa_bdc   TYPE bdcdata,
            wa_const TYPE /SIE/SSG_XCM_CUC,
            w_vbak   TYPE vbak,
            w_veda   TYPE veda,
            w_xcm_pr TYPE /sie/ssg_xcm_pr,
            w_vkorg  TYPE ty_vkorg.
    Variables
      DATA: l_repid    TYPE sy-repid,
            l_vakey    TYPE vakey,
            l_variant  TYPE varid-variant,
            l_vbeln    TYPE i,
            l_vkorg    TYPE i,
            l_vkbur    TYPE i,
            l_vkgrp    TYPE i,
            l_ckappl(40)   TYPE c,
            l_ckschl(40)   TYPE c,
            l_cauart(40)   TYPE c.
    Program Constants
      DATA: c_kappl    TYPE kappl,
            c_kschl    TYPE kschl,
            c_auart    TYPE auart,
            c_repco    TYPE /sie/ssg_xcm_const,
            c_value    TYPE /sie/ssg_xcm_value.
    ALV data declarations
      DATA:
          gt_fieldcat  TYPE slis_t_fieldcat_alv,
          gt_tab_group TYPE slis_t_sp_group_alv,
          gs_layout    TYPE slis_layout_alv,
          gs_repid     TYPE sy-repid,
          gs_sort      TYPE TABLE OF slis_sortinfo_alv.
    Selection screen
      SELECTION-SCREEN BEGIN OF BLOCK indletter WITH FRAME TITLE text-001.
      skip one line
        SELECTION-SCREEN SKIP.
        SELECT-OPTIONS:
                     contract
                       so_vbeln FOR w_vbak-vbeln,
                     category
                       so_auart FOR w_vbak-auart NO-DISPLAY,
                     Sales Org
                       so_vkorg FOR w_vbak-vkorg OBLIGATORY,
                     Dis Channel
                       so_vtweg FOR w_vbak-vtweg,
                     Division
                       so_spart FOR w_vbak-spart,
                     Sales Group
                       so_vkgrp FOR w_vbak-vkgrp,
                     Sales Office
                       so_vkbur FOR w_vbak-vkbur OBLIGATORY,
                     Cancellation Procedure
                       so_vkues FOR w_veda-vkuesch OBLIGATORY,
                     Contract Signed Date
                       so_vuntd FOR w_veda-vuntdat,
                     created by
                       so_ernam FOR w_vbak-ernam,
                     Fixed Indexation formula
                       so_fnum  FOR w_xcm_pr-fnum OBLIGATORY.
      skip one line
        SELECTION-SCREEN SKIP.
      Indexation letter
        PARAMETERS: rb_index  RADIOBUTTON GROUP radi USER-COMMAND usr.
      Follow up report
        PARAMETERS: rb_follo  RADIOBUTTON GROUP radi.
      skip one line
        SELECTION-SCREEN SKIP.
      Manual processing checkbox
        PARAMETERS:    p_manpr AS CHECKBOX.
      SELECTION-SCREEN END   OF BLOCK indletter.
    Printer block
      SELECTION-SCREEN BEGIN OF BLOCK blk_par WITH FRAME TITLE text-002.
      Printer
        PARAMETERS:     p_print  LIKE nast-ldest DEFAULT 'LOCL' OBLIGATORY.
      SELECTION-SCREEN END OF BLOCK blk_par.
    User selection data validation
      AT SELECTION-SCREEN ON so_vkorg.
    Ragne for sales org
      RANGES: r_vkorg FOR vbak-vkorg.
      REFRESH: it_const, r_vkorg.
      CLEAR   wa_const.
    Proceed for execution only for Sales Orgs in /SIE/SSG_XCM_CUC
      LOOP AT so_vkorg.
       r_vkorg-sign = 'I'.
       r_vkorg-option = 'EQ'.
       r_vkorg-low    = so_vkorg-low.
       APPEND r_vkorg.
    Check Sales Org intervals entered in the selection screen
       IF NOT so_vkorg-high IS INITIAL.
    Get all Sales Org for interval
         SELECT vkorg FROM tvko INTO TABLE it_vkorg
           WHERE vkorg BETWEEN so_vkorg-low AND so_vkorg-high.
         IF sy-subrc = 0.
         Add all Sales org into one internal table
           LOOP AT it_vkorg INTO w_vkorg.
             r_vkorg-low = w_vkorg-vkorg.
             APPEND r_vkorg.
             CLEAR: w_vkorg.
           ENDLOOP.
         delete repeated records
           DELETE ADJACENT DUPLICATES FROM r_vkorg COMPARING low.
         ENDIF.
       ENDIF.
       CLEAR r_vkorg.
      ENDLOOP.
    Get Sales Org entries maintained in /SIE/SSG_XCM_CUC
      l_repid = sy-repid.
    Check Sales Org is maintained for Renewal Letter?
      LOOP AT r_vkorg.
      concatenate constant with Sales Org
        CONCATENATE 'INX_LETTER_CREATE_' r_vkorg-low INTO c_repco.
      Get constant
        SELECT SINGLE value
          FROM /sie/ssg_xcm_cuc
          INTO c_value
         WHERE repid = l_repid
           AND const = c_repco
           AND vkorg EQ so_vkorg-low.
      Check alerady maintained?
        IF sy-subrc <> 0 OR
          ( sy-subrc = 0 AND c_value <> 'X' ).
        Issue massage 'Sales Org no permitted for renewal Letter'.
          MESSAGE E012.
          CLEAR: c_repco, r_vkorg.
          EXIT.
        ENDIF.
        CLEAR: c_repco, r_vkorg.
      ENDLOOP.
      AT SELECTION-SCREEN.
    Read single Sales Org
       READ TABLE so_vkorg INDEX 1.
       IF sy-subrc = 0.
         CLEAR: l_ckappl, l_ckschl, l_cauart, c_kappl, c_kschl, c_auart.
       for application
         CONCATENATE 'INX_LETTER_V1_' so_vkorg-low INTO l_ckappl.
       for output type
         CONCATENATE 'INX_LETTER_Y6C4_' so_vkorg-low INTO l_ckschl.
       document type
         CONCATENATE 'INX_LETTER_AUART_' so_vkorg-low INTO l_cauart.
       Get application
         SELECT SINGLE value FROM /sie/ssg_xcm_cuc
           INTO c_kappl WHERE repid = sy-repid AND const LIKE l_ckappl.
       Get output type
         SELECT SINGLE value FROM /sie/ssg_xcm_cuc
           INTO c_kschl WHERE repid = sy-repid AND const LIKE l_ckschl.
       Get document type
         SELECT SINGLE value FROM /sie/ssg_xcm_cuc
           INTO c_auart WHERE repid = sy-repid AND const LIKE l_cauart.
       ENDIF.
    find no of Sales org entries entered in the selection screen
       DESCRIBE TABLE so_vkorg LINES l_vkorg.
    find no of Sales office entries entered in the selection screen
       DESCRIBE TABLE so_vkbur LINES l_vkbur.
    find no of Sales Group entries entered in the selection screen
       DESCRIBE TABLE so_vkgrp LINES l_vkgrp.
    Check if enterred more than one entry
       IF l_vkorg = 1 AND l_vkbur = 1.
         add Sales Org, Sales office, Sales group for key
         IF NOT so_vkgrp[] IS INITIAL.
           CONCATENATE so_vkorg-low so_vkbur-low so_vkgrp-low INTO l_vakey.
         ELSE.
           CONCATENATE so_vkorg-low so_vkbur-low '%' INTO l_vakey.
         ENDIF.
         CONDENSE l_vakey.
       Get printer name for selection.
         SELECT SINGLE ldest FROM nach INTO p_print
          WHERE kappl = c_kappl AND kschl = c_kschl AND vakey LIKE l_vakey.
       ENDIF.
    Manual processing is possible for Renewal Letter in advance only
      IF p_manpr = 'X' AND rb_follo = 'X'.
        MESSAGE E017.
      ENDIF.
    Main Processing
    START-OF-SELECTION.
      Check for the Follow up report
        IF rb_follo = 'X'.
        Call Follow up report with Selection criteria
          SUBMIT /SIE/SWE_XCM_INDEX_FOLLOWUP
           USING SELECTION-SET l_variant
            WITH so_vbeln IN so_vbeln
            WITH so_vkorg IN so_vkorg
            WITH so_vtweg IN so_vtweg
            WITH so_spart IN so_spart
            WITH so_vkgrp IN so_vkgrp
            WITH so_vkbur IN so_vkbur
            WITH so_vkues IN so_vkues
            WITH so_vuntd IN so_vuntd
            WITH so_ernam IN so_ernam
            WITH so_fnum  IN so_fnum
            WITH p_kappl  EQ c_kappl
            WITH p_kschl  EQ c_kschl
            WITH p_auart  EQ c_auart
          AND RETURN.
        ELSE.
        Process for Indexation Report
          gs_repid = sy-repid.
        Get data.
          PERFORM get_data.
        Filter data based on Siemens France rules
          PERFORM process_data.
        Check contract data is available for selection criteria
          IF NOT it_cntrt[] IS INITIAL.
          create ALV output header
            PERFORM alv_fieldcat USING gt_fieldcat[].
          create ALV layout
            PERFORM alv_layout CHANGING gs_layout.
          Sort ALV output
            PERFORM alv_sort.
          display filtered contract data
            PERFORM output_data.
          ELSE.
          Display a message 'No records found'.
            MESSAGE I011.
            EXIT.
          ENDIF.
        ENDIF.
    *&      Form  get_data
          Retrieve contracts data from tables
    -->  p1        text
    <--  p2        text
    FORM get_data.
    Get contract data from VBAK and VEDA.
      SELECT avbeln   aaudat   a~kunnr
             bvuntdat bvbegdat
             bvdemdat bvenddat
        INTO CORRESPONDING FIELDS OF TABLE it_cntrt
        FROM vbak AS a INNER JOIN veda AS b
          ON avbeln = bvbeln
       WHERE a~vbeln   IN so_vbeln
         AND a~auart   EQ c_auart
         AND a~vkorg   IN so_vkorg
         AND a~vtweg   IN so_vtweg
         AND a~spart   IN so_spart
         AND a~vkgrp   IN so_vkgrp
         AND a~vkbur   IN so_vkbur
         AND a~ernam   IN so_ernam
         AND b~vposn   = '000000'
         AND b~vkuesch IN so_vkues
         AND b~vuntdat IN so_vuntd.
    ENDFORM.                    " get_data
    *&      Form  process_data
          text
    -->  p1        text
    <--  p2        text
    FORM process_data.
    Internal tables
      DATA: l_nast   TYPE TABLE OF nast,
            it_pr    TYPE TABLE OF /sie/ssg_xcm_pr.
    Work areas
      DATA: w_nast   TYPE nast,
            wa_pr    TYPE /sie/ssg_xcm_pr.
    local Variables
      DATA: l_datum1 TYPE sy-datum,
            l_datum2 TYPE sy-datum,
            l_d3last TYPE sy-datum,
            l_d3next TYPE sy-datum.
    current date.
      l_datum1 = sy-datum.
    Calcuate date after 3 months.
      CALL FUNCTION 'DATE_CREATE'
        EXPORTING
          ANZAHL_MONATE        = 3
          DATUM_EIN            = l_datum1
        IMPORTING
          DATUM_AUS            = l_datum2.
      l_datum2 = l_datum2 - 1.
      SORT it_cntrt BY KUNNR VBELN.
    Get corresponding records from /SIE/SSG_XCM_PR.
      SELECT vbeln posnr fnum
          FROM /SIE/SSG_XCM_PR
          INTO CORRESPONDING FIELDS OF TABLE it_pr
           FOR ALL ENTRIES IN it_cntrt
         WHERE vbeln = it_cntrt-vbeln
          AND posnr = it_cntrt-vposn
           AND fnum IN so_fnum.
    clear workarea
      CLEAR wa_cntrt.
    filter contracts agaist the table /SIE/SSG_XCM_PR records.
      LOOP AT it_cntrt INTO wa_cntrt.
        CLEAR wa_pr.
      check contracts available in table /SIE/SSG_XCM_PR
        READ TABLE it_pr INTO wa_pr WITH KEY vbeln = wa_cntrt-vbeln.
        IF sy-subrc <> 0.
            DELETE it_cntrt.
            CLEAR wa_pr.
            CONTINUE.
        ELSEIF sy-subrc = 0 AND NOT wa_pr-fnum IN so_fnum.
      if not available, do not consider this contract
            DELETE it_cntrt.
            CLEAR wa_pr.
            CONTINUE.
        ENDIF.
         Dont consider contracts expires before today and after 3 months.
        IF wa_cntrt-vdemdat > l_datum1.   "current date
               IF wa_cntrt-vdemdat(6) > l_datum2(6). "AND   "after 3 months
               delete contract
                 DELETE it_cntrt.
                 CLEAR wa_cntrt.
                 CONTINUE.
               ENDIF.
        ELSE.
            DELETE it_cntrt.
            CLEAR wa_cntrt.
            CONTINUE.
        ENDIF.
      Is contract renewal letter has been sent already?
      Get all records from NAST to find letter sent?
        SELECT kappl objky kschl nacha datvr
          FROM NAST
          INTO CORRESPONDING FIELDS OF TABLE l_nast
         WHERE kappl = c_kappl
           AND objky = wa_cntrt-vbeln
           AND kschl = c_kschl
           AND nacha = '1'.
        IF sy-subrc = 0.
           sort renewal letter sent dates by latest is first
             SORT l_nast BY datvr DESCENDING.
           Get latest nast record
             READ TABLE l_nast INTO w_nast INDEX 1.
             IF sy-subrc = 0.
                IF p_manpr <> 'X'.  " ignore 3 month logic
                    l_d3next = wa_cntrt-vdemdat(06).
                    l_d3next+6(2) = '01'.
                  Calcuate date after 3 months.
                    CALL FUNCTION 'DATE_CREATE'
                      EXPORTING
                        ANZAHL_MONATE        = -3
                        DATUM_EIN            = l_d3next
                      IMPORTING
                        DATUM_AUS            = l_d3last.
                    l_d3last = l_d3last + 1.
                  Check letter already sent year equals current year
                    IF w_nast-datvr BETWEEN l_d3last AND wa_cntrt-vdemdat.
                     do not consider it
                       DELETE it_cntrt.
                       CLEAR: l_d3last, wa_cntrt, w_nast, l_d3next.
                       CONTINUE.
                    ENDIF.
                ENDIF.
             ENDIF.
        ENDIF.
      no leading zeros to contract
        WRITE wa_cntrt-vbeln TO wa_cntrt-vbeln1 NO-ZERO.
      modify internal table
        MODIFY it_cntrt FROM wa_cntrt.
        CLEAR: l_nast, w_nast.
      ENDLOOP.
    ENDFORM.                    " process_data
    *&      Form  output_data
          text
    -->  p1        text
    <--  p2        text
    FORM output_data.
    Display output in a ALV Grid
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
           I_CALLBACK_PROGRAM                = gs_repid
           I_CALLBACK_PF_STATUS_SET          = 'ALV_STATUS'
           I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
           IS_LAYOUT                         = gs_layout
           IT_FIELDCAT                       = gt_fieldcat
           IT_SORT                           = gs_sort
           I_SAVE                            = 'A'
         TABLES
           T_OUTTAB                          = it_cntrt
         EXCEPTIONS
           PROGRAM_ERROR                     = 1
           OTHERS                            = 2
       IF SY-SUBRC <> 0.
           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
    ENDFORM.                    " output_data
    *&      Form  alv_header
          text
    -->  p1        text
    <--  p2        text
    FORM alv_fieldcat USING gs_fieldcat TYPE slis_t_fieldcat_alv.
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
    Sold-to Party header
      ls_fieldcat-col_pos = 1.
      ls_fieldcat-fieldname = 'KUNNR'.
      ls_fieldcat-seltext_m = 'Sold-to Party'.
      ls_fieldcat-outputlen = 14.
      ls_fieldcat-datatype  = 'CHAR'.
      ls_fieldcat-key       = 'X'.
      APPEND ls_fieldcat TO gs_fieldcat.
      CLEAR ls_fieldcat.
    Contract number
      ls_fieldcat-col_pos = 2.
      ls_fieldcat-fieldname = 'VBELN'.
      ls_fieldcat-seltext_m = 'Contract Number'.
      ls_fieldcat-outputlen = 20.
      ls_fieldcat-datatype  = 'CHAR'.
      APPEND ls_fieldcat TO gs_fieldcat.
      CLEAR ls_fieldcat.
    Contract Signed Date
      ls_fieldcat-col_pos = 3.
      ls_fieldcat-fieldname = 'VUNTDAT'.
      ls_fieldcat-seltext_m = 'Contract signed date'.
      ls_fieldcat-outputlen = 20.
      ls_fieldcat-datatype  = 'DATS'.
      APPEND ls_fieldcat TO gs_fieldcat.
      CLEAR ls_fieldcat.
    Contract Start Date
      ls_fieldcat-col_pos = 4.
      ls_fieldcat-fieldname = 'VBEGDAT'.
      ls_fieldcat-seltext_m = 'Contract start date'.
      ls_fieldcat-outputlen = '20'.
      ls_fieldcat-datatype  = 'DATS'.
      APPEND ls_fieldcat TO gs_fieldcat.
      CLEAR ls_fieldcat.
    Dismantling date
      ls_fieldcat-col_pos = 5.
      ls_fieldcat-fieldname = 'VDEMDAT'.
      ls_fieldcat-seltext_m = 'Dismantling date'.
      ls_fieldcat-outputlen = 14.
      ls_fieldcat-datatype  = 'DATS'.
      APPEND ls_fieldcat TO gs_fieldcat.
      CLEAR ls_fieldcat.
    ENDFORM.                    " alv_header
    *&      Form  alv_layout
          text
    -->  p1        text
    <--  p2        text
    FORM alv_layout USING ls_layout TYPE slis_layout_alv.
    No input
      ls_layout-no_input          = 'X'.
    Column width is flexible
    ls_layout-colwidth_optimize = 'X'.
      ls_layout-box_fieldname = 'BOX'.
      ls_layout-info_fieldname = 'LINE_COLOR'.
      ls_layout-zebra = 'X'.
      ls_layout-get_selinfos = 'X'.
      ls_layout-reprep = 'X'.
    ENDFORM.                    " alv_layout
    *&      Form  alv_status
          text
    -->  p1        text
    <--  p2        text
    FORM alv_status USING rt_extab TYPE slis_t_extab.
    GUI Status and Application Toolbar
      SET PF-STATUS '/SIE/SWE_XCM_INDEXLE'.
    ENDFORM.
    *&      Form  user_command
          text
    -->  p1        text
    <--  p2        text
    FORM user_command USING l_ucomm      LIKE sy-ucomm
                            l_selfield   TYPE slis_selfield.
      RANGES: r_kappl FOR nast-kappl,
              r_objky FOR nast-objky,
              r_kschl FOR nast-kschl,
              r_nacha FOR nast-nacha.
      DATA: l_jobname  TYPE TBTCJOB-JOBNAME,
            l_jobcount TYPE TBTCJOB-JOBCOUNT,
            l_repid    TYPE sy-repid,
            l_print_params TYPE PRI_PARAMS,
            l_arc_params   TYPE ARC_PARAMS,
            l_valid        TYPE c,
            l_retcode      TYPE sy-subrc,
            l_blines       TYPE i.
      CASE l_ucomm.
      Process button seleted
        WHEN c_sform.
        process selected records.
          LOOP AT it_cntrt INTO wa_cntrt.
             IF wa_cntrt-box = 'X'.
              place output type in the contract
                PERFORM bdc_output USING wa_cntrt
                                   CHANGING l_retcode.
                IF l_retcode = 0.
                add record for jobground job
                  r_objky-sign   = 'I'.
                  r_objky-option = 'EQ'.
                  r_objky-low    = wa_cntrt-vbeln.
                  APPEND r_objky.
                ENDIF.
                CLEAR: wa_cntrt, l_retcode, r_objky.
             ENDIF.
          ENDLOOP.
        WHEN c_dclick.
        set contract number id with the selected contract
          SET PARAMETER ID 'AUN' FIELD l_selfield-value.
          SET PARAMETER ID 'KTN' FIELD l_selfield-value.
        call va42 tcode when double click on contract
          CALL TRANSACTION c_tcode AND SKIP FIRST SCREEN.
      ENDCASE.
      DESCRIBE TABLE r_objky LINES l_blines.
    IF NOT r_objky[] IS INITIAL.
      IF l_blines > 0.
        Background job name.
          CONCATENATE 'XCM_INDEXATION' sy-uname '_' sy-uzeit
                 INTO l_jobname.
        Application
          r_kappl-sign   = 'I'.
          r_kappl-option = 'EQ'.
          r_kappl-low    = 'V1'.
          APPEND r_kappl.
        Message Type
          r_kschl-sign   = 'I'.
          r_kschl-option = 'EQ'.
          r_kschl-low    = c_kschl.
          APPEND r_kschl.
        Message transmission medium
          r_nacha-sign   = 'I'.
          r_nacha-option = 'EQ'.
          r_nacha-low    = '1'.
          APPEND r_nacha.
          l_repid = sy-repid.
        Print Parameters
          CALL FUNCTION 'GET_PRINT_PARAMETERS'
            EXPORTING
              DESTINATION                  = p_print
              MODE                         = c_batch
              NO_DIALOG                    = 'X'
              REPORT                       = l_repid
              EXPIRATION                   = 2
              IMMEDIATELY                  = 'X'
              NEW_LIST_ID                  = 'X'
            IMPORTING
              OUT_ARCHIVE_PARAMETERS       = l_arc_params
              OUT_PARAMETERS               = l_print_params
              VALID                        = l_valid
            EXCEPTIONS
              ARCHIVE_INFO_NOT_FOUND       = 1
              INVALID_PRINT_PARAMS         = 2
              INVALID_ARCHIVE_PARAMS       = 3
              OTHERS                       = 4.
          IF SY-SUBRC <> 0.
             MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        opening the job
          CALL FUNCTION 'JOB_OPEN'
            EXPORTING
              JOBNAME                = l_jobname
            IMPORTING
              JOBCOUNT               = l_jobcount
           EXCEPTIONS
             CANT_CREATE_JOB        = 1
             INVALID_JOB_DATA       = 2
             JOBNAME_MISSING        = 3
             OTHERS                 = 4.
          IF SY-SUBRC <> 0.
           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
        Job submit
          SUBMIT /sie/swe_xcm_index_rsnast00 TO SAP-SPOOL
                          USER sy-uname
                          WITH s_kappl IN r_kappl
                          WITH s_objky IN r_objky
                          WITH s_kschl IN r_kschl
                          WITH s_nacha IN r_nacha
                          WITH p_print  EQ p_print
             VIA JOB l_jobname NUMBER l_jobcount
             SPOOL PARAMETERS l_print_params
             WITHOUT SPOOL DYNPRO
             AND RETURN.
          IF sy-subrc <> 0.
          display message when error in scheduling background job
            MESSAGE E016 WITH 'Error scheduling Job'.
          ENDIF.
        Job close
          CALL FUNCTION 'JOB_CLOSE'
            EXPORTING
              JOBCOUNT                          = l_jobcount
              JOBNAME                           = l_jobname
              STRTIMMED                         = 'X'
           EXCEPTIONS
             CANT_START_IMMEDIATE              = 1
             INVALID_STARTDATE                 = 2
             JOBNAME_MISSING                   = 3
             JOB_CLOSE_FAILED                  = 4
             JOB_NOSTEPS                       = 5
             JOB_NOTEX                         = 6
             LOCK_FAILED                       = 7
             OTHERS                            = 8.
          IF SY-SUBRC <> 0.
             MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
      ENDIF.
    ENDFORM.
    *&      Form  bdc_output
          text
    -->  p1        text
    <--  p2        text
    FORM bdc_output USING    wa_cntrt  TYPE ty_cntrt
                    CHANGING l_retcode TYPE sy-subrc.
    DATA: l_nast TYPE TABLE OF nast,
           it_nast TYPE TABLE OF nast,
           w_nast TYPE nast,
           l_cellno(2) TYPE n,
           l_vbelv TYPE vbfa-vbelv,
           l_vbpa  TYPE vbpa,
           l_yes(1),
           l_temp(40) TYPE c,
           l_lines    TYPE i,
           l_lesscnt  TYPE i,
           l_less(1),
           l_lines1(2) TYPE n.
        REFRESH: it_nast, l_nast, it_bdc.
        CLEAR: l_nast, w_nast, l_yes, l_cellno,
               it_nast, l_nast, it_bdc.
        PERFORM dyn_scr USING 'SAPMV45A' '0102' 'X'.
          PERFORM dyn_fld USING 'VBAK-VBELN' wa_cntrt-vbeln.
          PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
        PERFORM dyn_scr USING 'SAPMV45A' '4001' 'X'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=HEAD'.
        PERFORM dyn_scr USING 'SAPMV45A' '4002' 'X'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=KDOK'.
        SELECT *
          FROM nast
          INTO CORRESPONDING FIELDS OF TABLE l_nast
         WHERE kappl = c_kappl
           AND objky = wa_cntrt-vbeln.
        IF sy-subrc = 0.
            SORT l_nast BY kschl vstat.
            DESCRIBE TABLE l_nast LINES l_lines.
            LOOP AT l_nast INTO w_nast.
                l_cellno = sy-tabix.
                IF w_nast-kschl = c_kschl AND w_nast-vstat = 0.
                  EXIT.
                ENDIF.
                IF w_nast-kschl > c_kschl OR
                   ( w_nast-kschl = c_kschl AND w_nast-vstat <> 0 ).
                   IF l_less = space.
                     l_cellno = l_cellno - 1.
                   ENDIF.
                   CLEAR l_less.
                  IF l_cellno = 0.
                     l_cellno = 1.
                  ENDIF.
                  l_lines = l_lines + 1.
                  l_lines1 = l_lines.
                  PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
                    CONCATENATE 'DNAST-KSCHL(' l_lines1 ')' INTO l_temp.
                    CONDENSE l_temp.
                    PERFORM dyn_fld USING l_temp 'Y6C4'.
                    CLEAR: l_temp, l_lines, l_lines1.
                    PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
                  EXIT.
                ELSEIF w_nast-kschl < c_kschl.
                  l_less = 'X'.
                  l_lesscnt = l_lesscnt + 1.
                ENDIF.
            ENDLOOP.
        ELSE.
            l_cellno = '01'.
            PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
              CONCATENATE 'DNAST-KSCHL(' l_cellno ')' INTO l_temp.
              CONDENSE l_temp.
              PERFORM dyn_fld USING l_temp 'Y6C4'.
              CLEAR l_temp.
              PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
        ENDIF.
        IF l_less = 'X'.
            l_lesscnt = l_lesscnt + 1.
                  l_cellno = l_lesscnt.
                  l_lines = l_lines + 1.
                  l_lines1 = l_lines.
                  PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
                    CONCATENATE 'DNAST-KSCHL(' l_lines1 ')' INTO l_temp.
                    CONDENSE l_temp.
                    PERFORM dyn_fld USING l_temp 'Y6C4'.
                    CLEAR: l_temp, l_lines, l_lines1.
                    PERFORM dyn_fld USING 'BDC_OKCODE' '/00'.
        ENDIF.
        PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
          CONCATENATE 'DV70A-SELKZ(' l_cellno ')' INTO l_temp.
          CONDENSE l_temp.
          PERFORM dyn_fld USING l_temp 'X'.
          CLEAR l_temp.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70P'.
        PERFORM dyn_scr USING 'SAPDV70A' '0101' 'X'.
          PERFORM dyn_fld USING 'NAST-LDEST' p_print.
          PERFORM dyn_fld USING 'NAST-DIMME' 'X'.
          PERFORM dyn_fld USING 'NAST-TDARMOD' '1'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70B'.
        PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
          CONCATENATE 'DV70A-SELKZ(' l_cellno ')' INTO l_temp.
          CONDENSE l_temp.
          PERFORM dyn_fld USING l_temp 'X'.
          CLEAR l_temp.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70I'.
        PERFORM dyn_scr USING 'SAPDV70A' '0102' 'X'.
          PERFORM dyn_fld USING 'NAST-VSZTP' '1'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70B'.
        PERFORM dyn_scr USING 'SAPDV70A' '0100' 'X'.
          PERFORM dyn_fld USING 'BDC_OKCODE' '=V70S'.
        CALL TRANSACTION c_tcode USING it_bdc
                                 MODE c_mode     "'N'
                                 UPDATE c_updat  "'A'
                                 MESSAGES INTO it_mesg.
        IF sy-subrc = 0.
          l_retcode = 0.
        ENDIF.
    ENDFORM.                    " bdc_output
    *&      Form  dyn_scr
          text
         -->P_0642   text
         -->P_0643   text
         -->P_0644   text
    FORM dyn_scr USING    P_0642
                          P_0643
                          P_0644.
        MOVE:  p_0642 TO wa_bdc-program,
               p_0643 TO wa_bdc-dynpro,
               p_0644 TO wa_bdc-dynbegin.
        APPEND wa_bdc TO it_bdc.
        CLEAR wa_bdc.
    ENDFORM.                    " dyn_scr
    *&      Form  dyn_fld
          text
         -->P_0654   text
         -->P_0655  text
    FORM dyn_fld USING    P_0654
                          P_0655.
       MOVE: p_0654 TO wa_bdc-fnam,
             p_0655 TO wa_bdc-fval.
       APPEND wa_bdc TO it_bdc.
       CLEAR wa_bdc.
    ENDFORM.                    " dyn_fld
    *&      Form  alv_sort
          text
    FORM alv_sort.
      DATA: wa_sortcat  TYPE slis_sortinfo_alv.
      WA_SORTCAT-SPOS      = 1.
      WA_SORTCAT-FIELDNAME = 'KUNNR'.
      WA_SORTCAT-UP        = 'X'.
      WA_SORTCAT-EXPA      = 'X'.
    Appending gd_sortcat-tabname
      APPEND WA_SORTCAT TO gs_sort.
      CLEAR wa_sortcat.
      WA_SORTCAT-SPOS      = 2.
      WA_SORTCAT-FIELDNAME = 'VBELN'.
      WA_SORTCAT-UP        = 'X'.
      WA_SORTCAT-EXPA      = 'X'.
    Appending gd_sortcat-tabname
      APPEND WA_SORTCAT TO gs_sort.
      WA_SORTCAT-SPOS      = 3.
      WA_SORTCAT-FIELDNAME = 'VUNTDAT'.
      WA_SORTCAT-UP        = 'X'.
      WA_SORTCAT-EXPA      = 'X'.
    Appending gd_sortcat-tabname
      APPEND WA_SORTCAT TO gs_sort.
    ENDFORM.                    " alv_sort

  • Smartforms and sap scripts

    Hello there
    I have copied a standard smart form Invioce and made minor changes in the form like adding a new field so now
    should we write the entire code from scratch  or there any diffrent ways.plz guide with a good example
    reward is expected
    prashanth

    Hello,
    U can use routines and get the required fields from seperate program for rouitnes.Instead of copying and modifying a print program,the best way is to use routines.
    Try this way and let me know if u face any problem.
    Regards

Maybe you are looking for

  • Can I create pdf files from Outlook 2003 messages with Acrobat XI Standard?

    Can I create pdf files from Outlook 2003 messages with Acrobat XI Standard?

  • How To Organize the Clips I Import?

    I just started on a project that involves putting together an iMovie video from vacations that were shot over the past 25 years.  I have imported about three now and I'm now realizing that i no indication which year they were taken unless i go throug

  • Can't sync with Blackberry software

    Hey Guys:  I have an 8830 and when I open the desktop software on my mac the message to "connect with the USB cable"  I can't move past this screen.  Any suggestions?  I have used pocket mac successfully for quite a while and this is a disappointment

  • Multiple/separate storage accounts?

    Hi, I plan to have a production SQL Server server and a test one.  For each, I plan to create separate logical drives: - 1 for data files - 1 for log files - 1 for TempDB OPTIONS: (1) Create all VHDs from the same storage account (2) Have one storage

  • Using a mac and a PC with iphone 3g

    I have an iphone 3g i was using with my old apple powerbook g4 i just bought an new PC  and i want to update my phone using the PC it won't let me.  Can you use a new computer to update and backup iphone 3g?