Invoice number on F150 dunning letter

Hi,
We need to have invoice number on the dunning letter on the trans code F150. May I know what are aspects or points we need to suggest to Abapers form the FI point of view
Thank you
Chaithra

hi,
Henri
Thanks for your response. May i know in detail about it please. Where to write these sap scripts please.
Thank you
Chiathra

Similar Messages

  • F150 : Dunning Letter

    Hi,
    Dunning letter procedure  (F150)  currently creates an output in PDF format but the remqt is to get the output in PDF and alos in text files with some modifications in the text file.
    Could anyone pls. help me how to achieve this.
    Thanks.
    Edited by: Sri KVS on May 20, 2010 9:55 AM

    Hi,
    sorry, here yesterday it was a day off.
    For the code, if you  want to copy the pdf you have to take the number of spool and convert it in an other pdf (but you will get the same printing). If you want to get an another form (different from the standard: no logo, header ...) you have to do a new form (smartform ou sapscript one) and to call this new form in the enhancement...
    if you do a new sapscript form: you should use: open_form.... write_element.... close form (like in the function standard F150_printing_notice)
    and if you use a smartform one, you should use the function     call function 'SSF_FUNCTION_MODULE_NAME'
    to know the function associate at your smarform form.
    and after
    call function lf_fm_name
            exporting
              archive_index        = toa_dara
              archive_index_tab    = tsfdara
              archive_parameters   = arc_params
              control_parameters   = ls_control_param
              mail_appl_obj        = ls_mail_appl_obj
              mail_recipient       = ls_recipient
              mail_sender          = ls_sender
              output_options       = ls_composer_param
              user_settings        = space
              is_vbdkr             = is_vbdkr
              is_nast              = is_nast
              iv_spras             = lv_spras
              iv_spras_ag          = lv_spras_do
            importing
              job_output_info      = ls_job_info
              document_output_info = ls_document_output_info
              job_output_options   = ls_job_output_options
              es_vbdkr             = vbdkr
            tables
              it_tvbdpr            = it_tvbdpr
            exceptions
              formatting_error     = 1
              internal_error       = 2
              send_error           = 3
              user_canceled        = 4
              others               = 5.
    for calling the form...
    It's depend of what you have to do: sapscript or smartform printing. But you will do a new form, i think
    Best regards
    Hote it'shelpfull

  • F150 : Dunning letter print

    Hi,
    I customized Form for a Dunning letter (level 1) in Tcode FBMP, but when I tried to print a dunning letter I get this message : 'Form ZF150_DUNN_1 does not exist'
    Is there any other customizing point must I do ?
    Please advise
    Regards.

    HI,
    It seems that the dunning form is not assigned properly
    In FBMA  click on dunning procedure - > dunning text - > give Company code -> And check whether form is assigned there
    Atlast   Try OBL6 might give you some idea
    hope this helps
    pbb

  • Need Help ON F150( DUNNING LETTER)

    Hi experts,
    i am working on Dunning form and my requirment is generate unique number and print it to the Our Reference field. i know that how to generate the unique number through number range object.
    But the point is where should i write that code that call the function module after clicking on the application toolbar Print option.
    that is on top of the screen
    please give me some idea....
    i m waiting for the ur valuable idea....

    Hi Ashu,
    You can create a subroutine and write form in it. This form...endform will contain your code. Then to call this form , add perform in your main window of script which is getting called.
    E.g :-
    /:           DEFINE &W_BUKRS& = &T001-BUKRS&
    /:           PERFORM F_VALIDATE_COUNTRY IN PROGRAM <SUBROUTINE_NAME>
    /:           USING &W_LAND1&
    /:           CHANGING &W_LAND1&
    Thanks,
    Rupali Punekar

  • F150-dunning letter printing conditions

    Hi All,
    dunning smart form(custom)was getting called from SAPF150D2 program ,but the problem is i need to restrict the smart form call based on some particular custom conditions like level1 should trigger after 15 days level 2 letter with 9 days like this(from ztable values)
    as of now i am restricting with in smartform code(global-initilization)which  leads to blank page printing for some customers with in the selected range(becuase i am deleting customer internal table based on conditions) so can any one please sugget how to restrict customers before smartform call.
    Thank you.

    Convert program into Z-Program and write a code before calling smartform.
    else try to check explicite enhancement for program .
    Thanks.
    Amit

  • F150 Dunning creation without increase Dunning level for document Type

    Hellò everybody,
    I have this request , How I can  do a dunning Letter  and for a specific Document type  , must have always a Dunnng level 1 . I mean do not increase the Dunning Level every time.
    For istance :
    Every week we make one dunning run. This run has to include all open invoices from ordinary deliveries (dunning level 1 to 3) and also  the open invoices for a specific Document type  (dunning level 1).   This Specific doc.type have not dunning level 2 or 3 .
    I have check on BTE and I have update  00001051 DUNNING: Read additional fields for MHND (BSID)  with this Abap code :
    IF I_BSID-BUKRS = 'KC01'.
            IF I_BSID-BLART = 'B2'.
          IF C_MHND-MAHNS IS NOT INITIAL.
            C_MHND-MAHNN = C_MHND-MAHNS.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDFUNCTION.
    But nothing happen ...
    Who can help to me ?
    Thanks in advance for everythings.
    Anna Rosa

    Hi Vassy , thanks for your prompt answer ,  I explain better with example :
    first time  Dunning  :  Customer AABB
    Invoice 1  100   lev 1    Special Invoice
    Invoice 2  200   lev 1
    Invoice 3 300    lev 1
    The Customer do not pay nothing
    Second Time Dunning Customer AABB
    Invoice 1  100   lev 1    Special Invoice
    Invoice 2  200   lev 2
    Invoice 3 300    lev 2
    Thirt time Dunning Customer AABB
    Invoice 1  100   lev 1    Special Invoice
    Invoice 2  200   lev 3
    Invoice 3 300    lev 3
    I mean in the same Dunning letter for invoice 2 and 3 the level Dunning increase(as usual)  for Special Invoice number 1 the Dunning Level   still remain 1.
    I know that I can change Manually on open Item the Dunning level but I looking for if it's possible to this automatically.
    Thanks a lot.
    Cheers.
    Anna Rosa

  • Problem in Display Dunning Letter - F150

    Dear Experts,
    While I run F150, for example for Customer XXXX.
    The Customer have 3 open item/ document number with different arrears (14, 60 and 180)
    which is the customer shoud be have 3 reminder letter (1, 2 and 3).
    But when I check the sample letters and display dunning notice, the dunning letter displayed
    only reminder 1 with detail list of his line items.
    Why reminder 2 and 3 not display in each document to be done?
    Fyi in FBMP the setting is:
    Days in arrears 14  60   180
    always dunn
    print all item
    Dunning interval in days : 1 ( my user want dunning run in everyday)
    Kindly advice.
    Thank you

    Hi Mohit,     
    Thanks for your respond.     
    It means: for 1 Customer, he will only have 1 reminder letter, depends on his previous dunning level;     
    even the customer have 3 documents/open items which have fullfill for 3 arrears? Therefore, 1 Customer will not have 3 reminder letter for 1 dunning run?     
    Is it correct?Kindly your respond.     
    Thank you in advance.

  • Send Dunning letter (TCODE F150) by email

    Dear Friends,
    I need to send a dunning letter(which is generating from tcode F150) through email to all the customers.I did BTE for event 00001040.function module is   SAMPLE_PROCESS_00001040. I copies above FM and rename as Z_RSAMPLE_PROCESS_00001040. I just add a break point statement and ran a F150 tcode. But it will not stoped at the breakpoint.
    I did FIBF settings also to register the modifications.
    Thanks
    Rasika

    How can i replace existinf FM with ZFM.
    What i did was i copied the existing FM to ZFM and activated it.
    After that i went FIBF Settings.....> Products.....>Customer and created a new Z product .
    *Again i took FIBF Settings.....>P/S Module......>of a Customer and add my ZFM to slected(00001040) event.
    After that i ran the F150 but break point did not apper.

  • Dunning letter F150 issue

    Hi ,
    I want to send dunning letter through F150 tcode.The customer wants both option email as well as print.I have done the coding for both.But the program takes only one option at a time. The client wants both the option that send mail as well as print.How to do this.
    Thanks & Regards,
    Anagha Deshmukh

    Hi,
    You can [Check this. Hope this might be helpful|Sending dunning letters by email;. And also [Check this thread.|Dunning letters Option - Print/email;.
    Thanks,
    Abhijit

  • Dunning letter - F150

    Hello all experts.
    I have a great request, who can help me with some information on dunning letter u2013 transaction code f150.
    I set the type of correspondence, i assigned to the F150_DUNN_01 to form SAPF150V program, i allocated the printing correspondence RFKORD10 to the company code, I created a new dunning area, dunning keys, dunning procedure (FBMP), 
    I set interest rates for calculating penaltys and when i run the transaction f150, it appear the with the positions of customer bills, but i is not penalty, instead appears a line called " dunning tax" in wich the system that divides the balance in 1000.
    I'm interested to appear in dunning the penalty for each line ithemes
    Please can you help me with some information or documentation with something more to the purpose.
    Thank you in advance.

    Hello,
    Into FBMP, at the dunning levels, you have to check "Calculate interests";
    Then you have to Define Interest Calculation Types into OB46 transaction.
    Then into dunning procedure, Define Interest Rates into OB42 transaction.
    Hope my answers will help.
    Regards,
    Aurelien

  • Dunning Letter with dued invoices copies attached

    Hi experts.
    The client is requesting to attach to the dunning letter copies from each dunned open invoice in a contract account.
    In other words, the dunning correspondence delivered to the customer will contain:
    1. A first page, with dunning information, as a dunning letter we all use.
    2. Other pages, as much as necessary, each one for each invoice dunned. Like physical copies from original invoice.
    How should we implement this?
    Best regards.

    Hello,
    I'm not too sure whether this can be achieved via Contract Account. But you can do in another way <workaround?>
    In FPSEC1, you can create a security deposit. Here you can upload the scanned documents.
    As security deposit you post would be a statistical posting <no posting to GL>, it should not be an issue to you.
    Or else alternatively if you have CRM also in your project, you can get this done by them. In T-Code CIC0/CICO, one can view the correspondence letters <I remember that you need to have a 'Z' program for this..check with your CRM colleagues>.
    Rgds
    Rajendra

  • Dunning letter via email with invoice attachments

    Hi Experts,
    We have requirement where in dunning letter should be send to customer via email along with invoice attachments.
    We have copied standard script F150_DUNN_02 to custom one as per requirements and configured it in SPRO. We are using BTE 1040 to fetch the customer email address and assign it to structure c_finaa-intad.
    This serves the purpose partially. The email goes to customer with dunning letter as an attachment properly.
    The question here is how to send additional invoice attachments in the same mail? For example, if dunning letter contains 3 line items, then email should have 4 attachments( 1 dunning letter and 3 invoices).
    Is it possible by some config steps? or please suggest me suitable approach to solve the problem.
    Appreciate your help.
    Thanks
    Swati

    Hi Partha,
    Here are the steps that you can follow :
    1. Using following SPRO path assign the dunning form.
    Financial Accounting (New) > Accounts Receivable and Accounts Payable > Business Transactions > Dunning > Printout > Assign Dunning Forms
    2. There is standard BTE (00001040) that is provided by SAP which is called when dunning is run. SAP has also provided sample function module SAMPLE_PROCESS_00001040 to indicate how to use the BTE. The FM imports I_KNA1 strutcure and pass back structure C_FINAA.
    3. Copy the standard FM to custom Z-FM and using I_KNA1-ADRNR fetch customer email address. If email is maintained, set c_finaa-nacha = 'I' and c_finaa-intad - <email>.
    4. You can also set the title of PDF file in email by setting c_itcpo-tdtitle as per requirement.
    5. Goto transaction FIBF. Settings-> Process Modules-> of SAP Application
    6. Add new entry with Process 00001040, application FI-FI and function module as custom FM created in step 3.
    Above steps are enough if you want to send dunning email to customer. If there is a need to send invoices as an attachments along with email then there is a need to enhance the standard FM PRINT_DUNNING_NOTICE. I used following approach to achieve the purpose.
    a. I created another custom FM to send invoices which I am calling from PRINT_DUNNING_NOTICE. For this, I am using implicit enhancement option to modify standard code. With this option, I am able to send 2 emails back-to-back one with dunning letter and other containing all invoice attachments with respect to dunning letter.
    Let me know, if you need further guidance.
    Regards,
    Swati

  • Dunning Letter for transaction F150

    Hi,
    I have developed a dunning letter , level 2 for transaction F150.
    As per the requirement it should display the balance in the beging rather than in last (as it was before)
    so I coped the print program and did some changes and Assigned that program to my sap script....
    but when i am going in debugging....
    it is taking the old program only...
    Anybody having any idea where to configure my new program??
    Thanks and Best Regards.
    Kusum.

    Hi Dubey,
    You can check the following customizing settings :
    Define Dunning Forms (with SAP Forms)
    We Require some standard u201CSPROu201D settings  :
    The standard settings allow us to create dunning notices using SAP Smart Forms, we must first define the corresponding function module in u201CSPROu201D.
    1. Financial Accounting (New) Financial Accounting Global Settings ( New )  -->Business Transaction Events.
    The SAP Business Framework screen appears.
    2. Choose Settings -> P/S function modules -> ... of an SAP appl. .
        Continue..
    3. Under the Business Transaction Event (BTE) "1720" with application indicator FI-FI, change the function module name and save your entries.
    Standard settings in u201CSPROu201D
    Financial Accounting (New)--> Accounts Receivable and Accounts Payable -->Business Transactions --> Dunning --> Printout ->Assign dunning forms.
    Select u2018Dunning Procedureu2019 and choose u2018Forms for normal dunning procedureu2019
    Choose u2018Company Codeu2019
    Change the name of your dunning form
    I thought, it will work for your requirement.
    Thanks
    Raghava Vakada

  • Help need for Dunning letter (F150)

    Hi Experts
    I have  a problem with dunning letter
    In level 1 only the client needs Two tables data , In table one i need to print the over due items only and in table two i need to display all items(it may overdue or not) in main window.
    In debug i have find PRINT_DUNNING_NOTICE (FM is triggring).
    i have printed the table one data by using the text elements 530 - Line item heading , 531-- Line item line layout ,
    My question is how to print the Table two data, i didnt find other text elements for solving the problem.
    in this case what needs to be done, can we create the same text elements like 530 & 531 & 581 & 582.
    Thanks in advance
    suresh

    Hi
    I got the Result by doing the below process..
    Dunning outputs use the function module FI_DUNNING_PRINT_NOTICE. You can copy this to a Z function module and make some changes to the data selection. You will have to look into the code and decide what changes you need.
    The process to use a bespoke program to do the dunning print is as follows:
    UNDER FI GLOBAL SETTINGS in the configuration,
    There are Business Transaction Events. Within that you can configure the same to enable a Z function module in place of the standard function module (from the FUNCTION GROUP F150)
    u2022 Create function group ZFTP_F150
    u2022 Copy standard function module FI_PRINT_DUNNING_NOTICE of function group F150 to ZFTP_FI_PRINT_DUNNING_NOTICE in function group ZFTP_F150
    u2022 Copy standard function module PRINT_DUNNING_NOTICE of function group F150 to ZFTP_PRINT_DUNNING_NOTICE in function group ZFTP_F150
    u2022 Within the function module ZFTP_FI_PRINT_DUNNING_NOTICE, change function module call for PRINT_DUNNING_NOTICE to ZFTP_PRINT_DUNNING_NOTICE
    u2022 Create a new include ZFTPI_ROUTINES within the function group and copy the subroutines LOG_MSG, LOG_MSG_TAB, & LOG_SYMSG from the function group F150 to this include
    AS AN ALTERNATE, YOU CAN COPY THE WHOLE FUNCTION GROUP
    u2022 Maintenance view TBE31 (SM30). Change the function module from FI_PRINT_DUNNING_NOTICE to ZFTP_FI_PRINT_DUNNING_NOTICE against the event 00001720 FI-FI entry

  • Dunning letter

    hi experts,
    iam asked to modify one standard sapscript and respective print program of dunning letter , for fi module. for tcode f150. original object is displaying dunning letter output for each customer. when i copied the same object and tried to execute, output is nil. i activated each and every include program etc, but in vain. according to FI consultant they dont maintain application in NACE. so i dnt know how to interlink print program and sapscript, in the original print program form name is not mentioned, i dnt know how the output is displayed in the form of sapscript.
    my requirement is as follows
    The customer is sent the gentle reminder letter for the out standing balances to be received by them. When ever the dunning program is run based on the dunning procedure assigned in the customer master and the level in the customer master, F150 program should be able to print the dunning letter for the customer correspondence.
    MY STANDARD PROGRAM IS FOLLOWS
    REPORT RFMAHN20 MESSAGE-ID FM NO STANDARD PAGE HEADING.
    declaration for dunning lists
    INCLUDE RFMAHNXXTOP.
    tables declaration
    TABLES: T001.
    declaration for independend forms
    INCLUDE RFMAHNXXFORM.
    declaration
    DATA: BEGIN OF MHNK_ACC,
            KOART       LIKE MHNK-KOART,
            BUKRS       LIKE MHNK-BUKRS,
            KUNNR       LIKE MHNK-KUNNR,
            LIFNR       LIKE MHNK-LIFNR,
            KONTO       LIKE MHNK-KUNNR,
            SELKEY      LIKE SY-TABIX,
            L_INCL      LIKE F150V-L_INCL,
            HSORT1(16)  TYPE C,
            HSORT2(16)  TYPE C,
            HSORT3(16)  TYPE C,
            HSORT4(16)  TYPE C,
            HSORT5(16)  TYPE C,
          END OF MHNK_ACC.
    declaration
    DATA:   T_MHNK     LIKE MHNK     OCCURS 10 WITH HEADER LINE.
    DATA    T_MHNK_ACC LIKE standard table of MHNK_ACC
              with key koart bukrs konto  WITH HEADER LINE.
    parameters & select options
    SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: P_KOART FOR MHNK-KOART,
                    P_BUKRS FOR MHNK-BUKRS,
                    P_KUNNR FOR MHNK-KUNNR,
                    P_LIFNR FOR MHNK-LIFNR.
    SELECTION-SCREEN END OF BLOCK 1.
    INITIALIZATION.
      H_REPID               = SY-REPID.
      H_ACTVT               = '13'.        "display dunning history
      H_TABNAME_HEADER      = 'MHNK_ACC'.
      H_TABNAME_ITEM        = 'MHNK_EXT'.
      H_SET_PF_STATUS       = 'SET_PF_STATUS'.
      H_USER_COMMAND        = 'USER_COMMAND_0001'.
      H_VARIANT-REPORT      = H_REPID.
      H_VARIANT-LOG_GROUP   = '0001'.
      H_VARIANT-HANDLE      = '0001'.
      H_LAYOUT-DETAIL_POPUP = 'X'.
    START-OF-SELECTION.
      select the information from MHNK
      SELECT * FROM MHNK INTO  TABLE T_MHNK
                         WHERE KOART IN P_KOART AND
                               BUKRS IN P_BUKRS AND
                               KUNNR IN P_KUNNR AND
                               LIFNR IN P_LIFNR.
      build the tables for the listviewer
      PERFORM CREATE_TABLES    TABLES   T_MHNK T_MHNK_ACC T_MHNK_EXT.
    END-OF-SELECTION.
      fill the fieldcatalog
      PERFORM FILL_FIELDCAT TABLES   T_FIELDCAT
                            USING    H_TABNAME_HEADER H_TABNAME_ITEM.
      determine the keyinfo
      PERFORM FILL_KEYINFO  CHANGING H_KEYINFO.
      register the list events
      PERFORM REGISTER_EVENTS TABLES T_EVENTS.
    Check if default-variant is existing (default or user-default )
    h_variant-variant has to be empty for this check, otherwise it is
    checked whether this variant is existing.
      H_VARIANT-VARIANT = SPACE.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
           EXPORTING
                I_SAVE        = 'A'
           CHANGING
                CS_VARIANT    = H_VARIANT
           EXCEPTIONS
                WRONG_INPUT   = 1
                NOT_FOUND     = 2
                PROGRAM_ERROR = 3
                OTHERS        = 4.
      IF SY-SUBRC = 2.
      default-variant not existing, therefor get variant 0
        H_VARIANT-VARIANT = '0'.
      ELSEIF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE 'S' NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      display the list
      CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
           EXPORTING
                I_INTERFACE_CHECK        = ' '
                I_CALLBACK_PROGRAM       = H_REPID
                I_CALLBACK_PF_STATUS_SET = H_SET_PF_STATUS
                I_CALLBACK_USER_COMMAND  = H_USER_COMMAND
                IS_LAYOUT                = H_LAYOUT
                IT_FIELDCAT              = T_FIELDCAT[]
                IT_EXCLUDING             =
                IT_SPECIAL_GROUPS        =
                it_sort                  = t_sort[]
                IT_FILTER                =
                IS_SEL_HIDE              =
    *--              i_screen_start_column    = 5
    *--              i_screen_start_line      = 5
    *--              i_screen_end_column      = 80
    *--              i_screen_end_line        = 25
                I_DEFAULT                = 'X'
                I_SAVE                   = 'A'
                IS_VARIANT               = H_VARIANT
                  IT_EVENTS                = T_EVENTS[]
                IT_EVENT_EXIT            =
                I_TABNAME_HEADER         = H_TABNAME_HEADER
                I_TABNAME_ITEM           = H_TABNAME_ITEM
                I_STRUCTURE_NAME_HEADER  =
                I_STRUCTURE_NAME_ITEM    =
                IS_KEYINFO               = H_KEYINFO
                IS_PRINT                 =
           IMPORTING
                E_EXIT_CAUSED_BY_CALLER  =
                ES_EXIT_CAUSED_BY_USER   =
           TABLES
                T_OUTTAB_HEADER          = T_MHNK_ACC
                T_OUTTAB_ITEM            = T_MHNK_EXT
           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.
    *&      Form  FILL_FIELDCAT
          text
         -->P_T_FIELDCAT  text                                           *
         -->P_H_TABNAME_HEADER  text                                     *
         -->P_H_TABNAME_ITEM  text                                       *
    FORM FILL_FIELDCAT TABLES TI_FIELDCAT STRUCTURE T_FIELDCAT
                       USING  I_HEADER TYPE SLIS_TABNAME
                              I_ITEM   TYPE SLIS_TABNAME.
    create the header fieldcat
      PERFORM APPEND_SEL_FIELDS  TABLES TI_FIELDCAT
                                 USING  I_HEADER.
      CLEAR TI_FIELDCAT.
      TI_FIELDCAT-TABNAME       = I_HEADER.
      TI_FIELDCAT-FIELDNAME     = 'KOART'.
      TI_FIELDCAT-SELTEXT_L     = TEXT-052.
      TI_FIELDCAT-SELTEXT_M     = TEXT-052.
      TI_FIELDCAT-SELTEXT_S     = TEXT-052.
      TI_FIELDCAT-REPTEXT_DDIC  = TEXT-052.
      TI_FIELDCAT-REF_FIELDNAME = 'KOART'.
      TI_FIELDCAT-REF_TABNAME   = 'MHNK'.
      APPEND TI_FIELDCAT.
      CLEAR TI_FIELDCAT.
      TI_FIELDCAT-TABNAME       = I_HEADER.
      TI_FIELDCAT-FIELDNAME     = 'BUKRS'.
      TI_FIELDCAT-SELTEXT_L     = TEXT-051.
      TI_FIELDCAT-SELTEXT_M     = TEXT-051.
      TI_FIELDCAT-SELTEXT_S     = TEXT-051.
      TI_FIELDCAT-REPTEXT_DDIC  = TEXT-051.
      TI_FIELDCAT-REF_FIELDNAME = 'BUKRS'.
      TI_FIELDCAT-REF_TABNAME   = 'MHNK'.
      APPEND TI_FIELDCAT.
      CLEAR TI_FIELDCAT.
      TI_FIELDCAT-TABNAME       = I_HEADER.
      TI_FIELDCAT-FIELDNAME     = 'KONTO'.
      TI_FIELDCAT-SELTEXT_L     = TEXT-050.
      TI_FIELDCAT-SELTEXT_M     = TEXT-050.
      TI_FIELDCAT-SELTEXT_S     = TEXT-050.
      TI_FIELDCAT-REPTEXT_DDIC  = TEXT-050.
      TI_FIELDCAT-REF_FIELDNAME = 'KONTO'.
      TI_FIELDCAT-REF_TABNAME   = 'F150V'.
      APPEND TI_FIELDCAT.
      CLEAR TI_FIELDCAT.
      TI_FIELDCAT-TABNAME       = I_HEADER.
      TI_FIELDCAT-FIELDNAME     = 'L_INCL'.
      TI_FIELDCAT-SELTEXT_L     =  TEXT-041.  " Kennz: Mahn. gedruckt
      TI_FIELDCAT-REPTEXT_DDIC  = 'L_INCL'.
      TI_FIELDCAT-REF_FIELDNAME = 'L_INCL'.
      TI_FIELDCAT-REF_TABNAME   = 'F150V'.
      APPEND TI_FIELDCAT.
      clear ti_fieldcat.
      ti_fieldcat-tabname       = 'MHNK_EXT'.
      ti_fieldcat-fieldname     = 'COMP_CURR'.
      ti_fieldcat-seltext_l     = text-053.
      ti_fieldcat-seltext_m     = text-053.
      ti_fieldcat-seltext_s     = text-053.
      ti_fieldcat-ref_fieldname = 'WAERS'.
      ti_fieldcat-ref_tabname   = 'MHNK'.
      append ti_fieldcat.
    perform append_sort_fields tables ti_fieldcat
                                using  i_header h_sort_info 'H'.
    create the item fieldcat
      PERFORM APPEND_SEL_FIELDS  TABLES TI_FIELDCAT
                                 USING  I_ITEM.
    generate fieldcat
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME         = H_REPID
                I_INTERNAL_TABNAME     = I_ITEM
                I_STRUCTURE_NAME       = 'MHNK'
                I_CLIENT_NEVER_DISPLAY = 'X'
               i_inclname             = 'RFMAHNXXTOP'
           CHANGING
                CT_FIELDCAT            = TI_FIELDCAT[]
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.
    for amounts in company currency establish link to MHNK_EXT-COMP_CURR
    so that summation in ALV is possible
      loop at ti_fieldcat.
        if ti_fieldcat-fieldname = 'SALHW' or
           ti_fieldcat-fieldname = 'FAEHW' or
           ti_fieldcat-fieldname = 'ZINHW' or
           ti_fieldcat-fieldname = 'FAMSH' or
           ti_fieldcat-fieldname = 'MHNGH'.
              ti_fieldcat-cfieldname = 'COMP_CURR'.
              ti_fieldcat-ctabname = 'MHNK_EXT'.
              modify ti_fieldcat.
        endif.
      endloop.
      CLEAR TI_FIELDCAT.
      TI_FIELDCAT-TABNAME       = I_ITEM.
      TI_FIELDCAT-SELTEXT_L     = TEXT-042. " 'Nur gedruckte Posten'.
    ti_fieldcat-seltext_m     = text-'Nur gedr. Posten'.
    ti_fieldcat-seltext_s     = 'Nur gedr. Post.'.
      TI_FIELDCAT-FIELDNAME     = 'L_INCL'.
      TI_FIELDCAT-REPTEXT_DDIC  = 'L_INCL'.
      TI_FIELDCAT-REF_FIELDNAME = 'L_INCL'.
      TI_FIELDCAT-REF_TABNAME   = 'F150V'.
      APPEND TI_FIELDCAT.
    perform append_sort_fields tables ti_fieldcat
                                using  i_item h_sort_info 'H'.
    select the fields to be shown
      PERFORM HIDE_ALL_FIELDS TABLES TI_FIELDCAT USING I_HEADER.
    select the fields to be shown
      PERFORM HIDE_ALL_FIELDS TABLES TI_FIELDCAT USING I_ITEM.
    ENDFORM.                               " FILL_FIELDCAT
    *&      Form  CREATE_TABLES
          text
    -->  p1        text
    <--  p2        text
    FORM CREATE_TABLES TABLES TI_MHNK     STRUCTURE MHNK
                              TI_MHNK_ACC STRUCTURE MHNK_ACC
                              TI_MHNK_EXT STRUCTURE MHNK_EXT.
      data : begin of comp_curr,
             bukrs like mhnk-bukrs,
             waers like mhnk-waers,
           end of comp_curr.
      data bukrs_tab like comp_curr occurs 0 with header line.
    sort the table
      SORT TI_MHNK BY KOART BUKRS KUNNR LIFNR ASCENDING.
    build t_mhnk_ext
      LOOP AT TI_MHNK.
      check authority
        PERFORM CHECK_AUTHORITY USING    '13' TI_MHNK-KOART TI_MHNK-BUKRS
                                CHANGING H_AUTHORITY_OK.
        IF H_AUTHORITY_OK = SPACE.
          CONTINUE.
        ENDIF.
      save wa
        MHNK = TI_MHNK.
      create item entry
        MOVE-CORRESPONDING MHNK TO TI_MHNK_EXT.
        IF TI_MHNK_EXT-KOART = 'D'.
          TI_MHNK_EXT-KONTO = TI_MHNK_EXT-KUNNR.
        ELSE.
          TI_MHNK_EXT-KONTO = TI_MHNK_EXT-LIFNR.
        ENDIF.
        TI_MHNK_EXT-HSORT1 = <F1>.
        TI_MHNK_EXT-HSORT1 = <F2>.
        TI_MHNK_EXT-HSORT1 = <F3>.
        TI_MHNK_EXT-HSORT1 = <F4>.
        TI_MHNK_EXT-HSORT1 = <F5>.
      check if item has been printed already
        IF NOT TI_MHNK_EXT-PRNDT IS INITIAL.
          TI_MHNK_EXT-L_INCL = 'X'.
        ELSE.
          TI_MHNK_EXT-L_INCL = SPACE.
        endif.
        read table bukrs_tab with key bukrs = ti_mhnk_ext-bukrs.
        if sy-subrc <> 0.
          select single * from t001 where bukrs = ti_mhnk_ext-bukrs.
          if sy-subrc = 0.
            bukrs_tab-waers = t001-waers.
            bukrs_tab-bukrs = ti_mhnk_ext-bukrs.
            append bukrs_tab.
          endif.
        endif.
        ti_mhnk_ext-comp_curr = bukrs_tab-waers.
        APPEND TI_MHNK_EXT.
      create header entry
        MOVE-CORRESPONDING MHNK TO TI_MHNK_ACC.
        IF TI_MHNK_ACC-KOART = 'D'.
          TI_MHNK_ACC-KONTO = TI_MHNK_ACC-KUNNR.
        ELSE.
          TI_MHNK_ACC-KONTO = TI_MHNK_ACC-LIFNR.
        ENDIF.
        COLLECT TI_MHNK_ACC.
      ENDLOOP.
    determine if account has at least one printed dunning
      LOOP AT TI_MHNK_ACC.
        READ TABLE TI_MHNK_EXT WITH KEY  KOART  = TI_MHNK_ACC-KOART
                                         BUKRS  = TI_MHNK_ACC-BUKRS
                                         KUNNR  = TI_MHNK_ACC-KUNNR
                                         LIFNR  = TI_MHNK_ACC-LIFNR
                                         KONTO  = TI_MHNK_ACC-KONTO
                                         L_INCL = 'X'.
        IF SY-SUBRC = 0.
          TI_MHNK_ACC-L_INCL = 'X'.
          MODIFY TI_MHNK_ACC.
        ENDIF.
      ENDLOOP.
    ENDFORM.                               " CREATE_TABLES
    *&      Form  FILL_KEYINFO
          text
         <--P_H_KEYINFO  text                                            *
    FORM FILL_KEYINFO CHANGING E_KEYINFO TYPE SLIS_KEYINFO_ALV.
      MOVE 'KOART' TO : E_KEYINFO-HEADER01,E_KEYINFO-ITEM01.
      MOVE 'BUKRS' TO : E_KEYINFO-HEADER02,E_KEYINFO-ITEM02.
      MOVE 'KONTO' TO : E_KEYINFO-HEADER03,E_KEYINFO-ITEM03.
    ENDFORM.                               " FILL_KEYINFO
    *&      Form  SET_PF_STATUS
          text
         -->P_RT_EXTAB  text                                             *
         -->P_TYPE  text                                                 *
         -->P_SLIS_T_EXTAB  text                                         *
    FORM SET_PF_STATUS USING I_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'HIST_MAX' EXCLUDING I_EXTAB.
    ENDFORM.                               " SET_PF_STATUS
    *&      Form  USER_COMMAND_0001
          text
    -->  p1        text
    <--  p2        text
    FORM USER_COMMAND_0001 USING I_UCOMM     LIKE SY-UCOMM
                                 I_SELFIELD  TYPE SLIS_SELFIELD.
      CASE I_UCOMM.
        WHEN 'DISP'.
          PERFORM COMMAND_DISP USING I_SELFIELD.
      ENDCASE.
    ENDFORM.
    *&      Form  COMMAND_DISP
          text
    -->  p1        text
    <--  p2        text
    FORM COMMAND_DISP CHANGING E_SELFIELD TYPE SLIS_SELFIELD.
    declaration
      DATA: TH_MHND     LIKE MHND OCCURS 10 WITH HEADER LINE,
            TH_MHNK     LIKE MHNK OCCURS 1 WITH HEADER LINE.
    determine the current line
      IF E_SELFIELD-TABNAME = H_TABNAME_ITEM.
        READ TABLE T_MHNK_EXT INDEX E_SELFIELD-TABINDEX.
        MOVE-CORRESPONDING T_MHNK_EXT TO TH_MHNK.
        APPEND TH_MHNK.
      ELSE.
        MESSAGE E481.
        EXIT.
      ENDIF.
    determine the mhnd entries for the actual mhnk
      SELECT * FROM  MHND INTO TABLE TH_MHND
             WHERE  LAUFD       = TH_MHNK-LAUFD
             AND    LAUFI       = TH_MHNK-LAUFI
             AND    KOART       = TH_MHNK-KOART
             AND    BUKRS       = TH_MHNK-BUKRS
             AND    KUNNR       = TH_MHNK-KUNNR
             AND    LIFNR       = TH_MHNK-LIFNR
             AND    CPDKY       = TH_MHNK-CPDKY
             AND    SKNRZE      = TH_MHNK-SKNRZE
             AND    SMABER      = TH_MHNK-SMABER
             AND    SMAHSK      = TH_MHNK-SMAHSK.
    change the dunning data
      CALL FUNCTION 'EDIT_DUNNING_DATA'
           EXPORTING
                I_MHNK     = TH_MHNK
                I_XDISPLAY = 'X'
           TABLES
                T_MHND     = TH_MHND
                T_MHNK     = TH_MHNK
           EXCEPTIONS
                OTHERS     = 1.
    ENDFORM.                               " COMMAND_DISP
    *&      Form  REGISTER_EVENTS
          text
         -->P_T_EVENT  text                                              *
    FORM REGISTER_EVENTS TABLES T_EVENT TYPE SLIS_T_EVENT.
    determine the events
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                I_LIST_TYPE     = 1
           IMPORTING
                ET_EVENTS       = T_EVENT[]
           EXCEPTIONS
                LIST_TYPE_WRONG = 1
                OTHERS          = 2.
    set top of page form
      READ TABLE T_EVENT WITH KEY NAME = SLIS_EV_TOP_OF_PAGE.
      IF SY-SUBRC EQ 0.
        T_EVENT-FORM = 'TOP_OF_PAGE'. MODIFY T_EVENT INDEX SY-TABIX.
      ENDIF.
    set top of list form
      READ TABLE T_EVENT WITH KEY NAME = SLIS_EV_TOP_OF_LIST.
      IF SY-SUBRC EQ 0.
        T_EVENT-FORM = 'TOP_OF_LIST'. MODIFY T_EVENT INDEX SY-TABIX.
      ENDIF.
    set end of list
      READ TABLE T_EVENT WITH KEY NAME = SLIS_EV_END_OF_LIST.
      IF SY-SUBRC EQ 0.
        T_EVENT-FORM = 'END_OF_LIST'. MODIFY T_EVENT INDEX SY-TABIX.
      ENDIF.
    ENDFORM.                               " REGISTER_EVENTS
          FORM TOP_OF_PAGE                                              *
    FORM TOP_OF_PAGE.
      PERFORM BATCH-HEADING(RSBTCHH0).
    ENDFORM.                               " TOP_OF_PAGE
          FORM TOP_OF_LIST                                              *
    FORM TOP_OF_LIST.
    *- Standardseitenkopf fuellen -
      MOVE '0'      TO BHDGD-INIFL.
      MOVE SY-LINSZ TO BHDGD-LINES.
      MOVE SY-UNAME TO BHDGD-UNAME.
      MOVE SY-REPID TO BHDGD-REPID.
      CLEAR: LINE.
      WRITE TEXT-040 TO BHDGD-LINE2.
    ENDFORM.
          FORM END_OF_LIST                                              *
    FORM END_OF_LIST.
      WRITE: / TEXT-039.
    ENDFORM
    regards
    maaya

    Hi,
    I copied your program and executed it. First of all, I dont think its a print program for any script. Its a plain ALV report program. I think you mis-understood the requirement or I totally lost the question.
    Make sure you are changing the correct program.
    Regards
    Aneesh.

Maybe you are looking for