Dynamic selection of check boxes on selecting a check box

Hi Friends,
I have to select the check boxes which are herarchically lower to a top check box,dynamically.
Eg:
Checkbox1
   checkbox2
   checkbox3
so if i select check box 1, on the screen both checkbox2 and checkbox3 have to be selected.
I did like below.
AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF P_ALL = 'X'.
      P_VAT = 'X'.
      P_NAME = 'X'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.
but values are checked but on screen its not checked.
how to handle this.
Regards,
Simha

hi
do like this
paramenter: check_1  type c as check box at user-command ,
check_2 type c as checkbox default X,
check_3 type c as checkbox default X.
At selection Sreen output
if check_1 = 'X'.
loop at screen .
if screen-name = 'check_2'.
screen-invisible  = '0'.
endif.
endloop.
loop at screen .
if screen-name = 'check_3'.
screen-invisible  = '0'.
endif.
endloop.
else
loop at screen .
if screen-name = 'check_2'.
screen-invisible  = '1''.
endif.
endloop.
loop at screen .
if screen-name = 'check_3'.
screen-invisible  = '1'.
endif.
endloop.
endif.
this solve ur problem
Cheers
Snehi

Similar Messages

  • Creating Dynamic select boxes

    Can we create dynamic select boxes which will change when the user selection changes. How many levels we can go about.
    For example
    we have one combo box named states--> depending upon the states selected the corresponding districts should be shown in the other combo box, and when the user selects a district it should show the corresponding villages or towns and further..
    Can we do it without ajax concept. if yes how?
    If we have to use ajax one level is easy how to go about two or three levels.
    Thanks in advance.

    Hi !
    ya it is possible to change values of Combobox depending on the value changed in another combobox.
    it is possible when you implement Model and by reference of that
    model you can change values of that combobox such as.
    model1.removeAllItems();
    model1.addItemAt(location); etc
    inspite of this if you need code help i will provide it to you.

  • Dynamic Selection option in the selection screen

    Hi ,
    I have a requirement like this ....
    The user wants some fields to be default available in the selection screen. But they also want to be able to select the data based on additional fields (all the remaining fields ) which they want to see in the dynamic selection .
    The basic list for selections should be limited to the fields listed in the specifications provided to me and the remaining fields should be made available through the dynamic selection option.
    In the transaction FBL3N , this facility is provided.
    Kindly help me with this..
    thanks,
    Sumit .

    Hi Sumit,
    To include dynamic selection check this sample code.
    TYPE POOLS DECLARATIONS FOR VALUE REQUEST MANAGER AND ICONS
    TYPE-POOLS : vrm,
                 icon.
    *SELECTION SCREEN FIELDS
    TABLES : sscrfields.*GLOBAL DECLARATIONS
    DATA : flag TYPE c,
          tablename(10),
          mmtable LIKE dd02l-tabname,
          sdtable LIKE dd02l-tabname,
          hrtable LIKE dd02l-tabname.*DECLARATIONS FOR SELECTION SCREEN STATUS
    DATA it_ucomm TYPE TABLE OF sy-ucomm.***********SELECTION-SCREENS**********************
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.*FOR DYNAMIC DISPLAY OF MODULES
    PARAMETERS :  pa RADIOBUTTON GROUP rad USER-COMMAND com MODIF ID mod,
                  pb RADIOBUTTON GROUP rad MODIF ID rad,
                  pc RADIOBUTTON GROUP rad MODIF ID cad.SELECTION-SCREEN SKIP.**TO INCLUDE DYNAMIC ICONS
    SELECTION-SCREEN COMMENT 2(6) text_001.*DYNAMIC LIST BOX BASED ON USER SELECTIONS
    PARAMETERS one AS LISTBOX VISIBLE LENGTH 20  MODIF ID mod.
    PARAMETERS two AS LISTBOX VISIBLE LENGTH 20   MODIF ID rad.
    PARAMETERS three AS LISTBOX VISIBLE LENGTH 20 MODIF ID cad.SELECTION-SCREEN END OF BLOCK blk1.*DISPLAY DYNAMIC PUSHBUTTON ON APP TOOLBAR ON USER CLICKS
    SELECTION-SCREEN: FUNCTION KEY 1,
                      FUNCTION KEY 2,
                      FUNCTION KEY 3.**EVENT ON SELECTION SCREEN FOR OUTPUT DISPLAY
    AT SELECTION-SCREEN OUTPUT.*CLICK OF FIRST RADIO BUTTON
      IF pa = 'X'.
        sscrfields-functxt_01 = 'Materials Management'.
        WRITE icon_plant AS ICON TO text_001.
    *CODE TO GET DYNAMICS BASED ON THE SELECTED RADIO
        LOOP AT SCREEN.
          IF screen-group1 = 'MOD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'RAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.*CLICK OF SECOND RADIO
      IF pb = 'X'.
        sscrfields-functxt_02 = 'Sales And Distribution'.
        WRITE icon_ws_ship AS ICON TO text_001.
        LOOP AT SCREEN.
          IF screen-group1 = 'RAD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'MOD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.*CLICK OF THIRD RADIO
      IF pc = 'X'.
        sscrfields-functxt_03 = 'Human Resources'.
        WRITE icon_new_employee AS ICON TO text_001.
        LOOP AT SCREEN.
          IF screen-group1 = 'RAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'MOD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.*CUSTOMISING THE TOOLBARS OF THE SELECTION SCREEN
    *WITH F8 BUTTON DISABLED  APPEND :  'PRIN' TO it_ucomm,
                'SPOS' TO it_ucomm,
                'ONLI' TO it_ucomm.  CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
        EXPORTING
          p_status  = sy-pfkey
        TABLES
          p_exclude = it_ucomm.
    **EVENT ON THE SELECTION
    AT SELECTION-SCREEN.* LIST BOX ONE VALUES
      CASE one.
        WHEN '1'.
          mmtable = 'MARC'.
        WHEN '2'.
          mmtable = 'MARA'.
        WHEN '3'.
          mmtable = 'MARD'.
        WHEN '4'.
          mmtable = 'MARM'.
      ENDCASE.* LIST BOX TWO VALUES
      CASE two.
        WHEN '1'.
          sdtable = 'VBAK'.
        WHEN '2'.
          sdtable = 'VBAP'.
        WHEN '3'.
          sdtable = 'VBUK'.
        WHEN '4'.
          sdtable = 'VBUP'.
      ENDCASE.* LIST BOX THREE VALUES
      CASE three.
        WHEN '1'.
          hrtable = 'PA0001'.
        WHEN '2'.
          hrtable = 'PA0006'.
        WHEN '3'.
          hrtable = 'PA0022'.
        WHEN '4'.
          hrtable = 'PA0008'.
      ENDCASE.*VALUES FOR CLICK OF THE PUSHBUTTON ON APP TOOLBAR
    *AND ENABLING THE BUTTONS TO PERFORM F8
      CASE sscrfields-ucomm.
        WHEN 'FC01'.
          tablename = mmtable.
          sscrfields-ucomm = 'ONLI'.
        WHEN 'FC02'.
          tablename = sdtable.
          sscrfields-ucomm = 'ONLI'.
        WHEN 'FC03'.
          tablename = hrtable.
          sscrfields-ucomm = 'ONLI'.
      ENDCASE.*INITIALIZATION EVENT
    INITIALIZATION.*VALUES ASSIGNED TO DROPDOWNLISTS IN THE SUBROUTINES
      PERFORM f4_value_request_pa.
      PERFORM f4_value_request_pb.
      PERFORM f4_value_request_pc.*START OF SELECTION EVENT
    START-OF-SELECTION.*SUBROUTINE FOR OUTPUT
      PERFORM output.*&----------------------------------------------------------------*
    *&      Form  f4_value_request_PA
    *       text
    *SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST1
    FORM f4_value_request_pa.  DATA: l_name TYPE vrm_id,
            li_list TYPE vrm_values,
            l_value LIKE LINE OF li_list.  l_value-key = '1'.
      l_value-text = 'Plant Data for Material'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '2'.
      l_value-text = 'General Material Data'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '3'.
      l_value-text = 'Storage Location Data for Material'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '4'.
      l_value-text = 'Units of Measure for Material'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_name = 'ONE'.  CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = l_name
          values          = li_list
        EXCEPTIONS
          id_illegal_name = 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. " f4_value_request_tabname*&----------------------------------------------------------------*
    *&      Form  f4_value_request_PB
    *       text
    *SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST2FORM f4_value_request_pb.  DATA: l_name TYPE vrm_id,
            li_list TYPE vrm_values,
            l_value LIKE LINE OF li_list.  l_value-key = '1'.
      l_value-text = 'Sales Document: Header Data'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '2'.
      l_value-text = 'Sales Document: Item Data'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '3'.
      l_value-text = 'Sales Document:Header Status'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '4'.
      l_value-text = 'Sales Document: Item Status'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_name = 'TWO'.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = l_name
          values          = li_list
        EXCEPTIONS
          id_illegal_name = 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. " f4_value_request_PB*&----------------------------------------------------------------*
    *&      Form  f4_value_request_PC
    *       text
    *SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST3FORM f4_value_request_pc.  DATA: l_name TYPE vrm_id,
            li_list TYPE vrm_values,
            l_value LIKE LINE OF li_list.  l_value-key = '1'.
      l_value-text = 'HR Master :Infotype 0001 (Org. Assignment)'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '2'.
      l_value-text = 'Address Infotype 0006'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '3'.
      l_value-text = 'Education Infotype 0022'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '4'.
      l_value-text = 'Basic Pay Infotype 0008'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_name = 'THREE'.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = l_name
          values          = li_list
        EXCEPTIONS
          id_illegal_name = 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. " f4_value_request_PC
    *&      Form  OUTPUT
    *       text
    *      -->P_TABLENAME  text
    *fINAL OUTPUT
    FORM output.  DATA p_table(10).  p_table = tablename.*popup to display teh selected table and
    *Continue button is clicked
      CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
        EXPORTING
          titel        = 'User Selections '
          textline1    = p_table
          textline2    = 'is the Selected table'
          start_column = 25
          start_row    = 6.*assigning the table value in p_table to the
    * Table in SE16 transaction by explicitly calling
      SET PARAMETER ID 'DTB' FIELD p_table.
      CALL TRANSACTION 'SE16'.
    ENDFORM.                    "OUTPUT
    Regards,
    Manoj Kumar P

  • Dynamically selection of Message Subject in AS2 adapter. Urgent Help..!!

    Hi All,
    I need to send the message to partner by using AS2 adapter.
    And i need to keep the Message Subject by taking dynamically from the payload message.
    ie. Iam sending the Purchase Order to Partner and i need to pass OrderNO which is coming in one field of my strcture to the message subject.
    How i can select dynamically the Orderno and pass into message subject of AS2 Receiver adapter??
    In the Seeburger AS2adpter manual, they provide the answer by using module parameters like
    http://seeburger.com/xi/common/dtsubject   DYNSUBJECT
    But i don't know how to put particular field into it.
    Any idea abt this?
    Regards
    Deepthi.

    Hi Deepthi,
    I think this would help you in configuring Dynamically selection of Message Subject.
    Supported dynamic attributes are:
    •  dtSubject – if the subject parameter is set in the XI message and the AS2 receiver channel is
          configured to use all non-empty or subject attribute, it will be treated as the message subject
          by the AS2 adapter;
    •  dtAS2FileName – the name of the payload. This is an attribute of the Content-Disposition
          header. With this AS2 is compatible with AS2 Filename Preservation draft.
    •  dtAS2ContentType – for Example application/xml, depending on the payload type
    To enable the usage of Dynamic Attributes, there is a special dedicated section in receiver channel.
    Dynamic attributes are used if the “Use dynamic attributes” setting is checked in the receiver channel.
    If the the setting “Use non-empty attributes” is not selected, all known attributes are used for
    configuration if the attribute is present. 
    Mention Check boxes for these
              Use dynamic Attributes
              Subject
    Dynamically set attributes override static channel attributes. Example: the subject attrib
    in receiver channels overrides the channel attribute.
    Here is an example how to set them. Channel tab “Module”->”Module Configuration”:
    Module Key: 1
    Parameter Name: http://seeburger.com/xi/common/dtsubject
    Parameter Value: DYNSUBJECT
    Message Subject:  This subject will be compared with the subject in the received message. This is used to find the correct channel for the inbound message.
    Wildcards are allowed.
    Regards,
    Varun Reddy.K

  • How to default the Document Type in Dynamic selections linked with DDF LDB?

    Hello all,
    A report is associated with Logical database DDF. In the selection screen we have Dynamic selections screen in which Document type is one of the fields. As per the requirement, this field document type(BLART) needs to be filled by default on certain actions done by the user. To be more precise when user clicks on a particluar check box, then document type values from a customized table should appear in that parameter in dynamic selections.
    Query here is I am not able to track the selection screen name for those dynamic fields. Can you please guide me in knowing the selection screen name for document type so that I can append values into it upon certain actions. I tried to check in the LDB 'DDF'  but I could not get any apt information there.
    Thanks in advance.
    Chandra.

    Hi,
    In the report event at selection-screen output, based on the user action you can do that try like below:
    at selection-screen output.
    if p_checkbox = 'X'.  "Checkbox checked
        s_blart-low = 'F'.
       s_blart-option = 'EQ'.
      s_blart-sign = 'I'.
      append s_blart.
    endif.
    Regards,
    Himanshu

  • Dynamic selection button on report RCATS_APPROVE_ACTIVITIES

    Hi,
    I made a copy of the program RCATS_APPROVE_ACTIVITIES with all its components, and the dynamic selection button on the selection screen doesn't work like the standard.
    In my researches, I found that the dynamic selection that the standard program uses is associated to the logical database 'PNP', but the logical database that the programs uses is 'PNPCE', and that's the dynamic selection that my program copy is showing.
    Does any one have an idea how this happens and how to solve?
    Thanks.
    Sónia

    Hi Sonia,
    You program is using dynamic selection screen which actually is the selection screen of your logical database. You can see that thru tcode SE36-> PNP->click on selection check box. You will see the code of selection screen. This selection screen is called in standard program and since you have copied the standard program, your program is also showing the same selection screen. LDB can be called in standard program thru Function module LDB_PROCESS.
    In case you want to remove some of the selection screen fields of LDB from your report, you can do so in the
    'at selection-screen output' event by looping at the selection screen variables and stopping unwanted fields from display.
    You need to check the group name and the field name of the fields you want to disable and use it in the below code accordingly.
    e.g.
    at selection-screen output.
    loop at screen.
    if screen-group2 = 'DBS'.
          screen-active    = 0.
          screen-invisible = 1.
    endif.
    modify screen.
    endloop.
    Cheers,
    Vikram
    Please reward for the helpful replies!!

  • Dynamic Selection on Checkboxes?

    I want to make a new checkbox component that has the dynamic selection property capability found in the Xcelsius combo box component.  It would just tie to a cell and show checked or unchecked depending on whether the cell was a 0 or 1.
    Is that currently supported in the Xcelsius SDK and if so, can someone help me with how that would look in the propertysheet?
    From the combo box example, the way to tie "selectedItem" to the Excel is with:
    case "selectedItem":
                                  // User explicitly cleared binding, do not create another.
                                  if ((bindingID == null) || (bindingID == ""))
                                       dataInsertEditor.enabled = true;      // Re-enable manual entry.
                                       // Fill the control back with current value instead of range address.
                                       propertyValues = proxy.getProperties([propertyName]);
                                       propertyObject = propertyValues[0];
                                       dataInsertEditor.text = String(propertyObject.value);
                                       // Make sure we set the property on the component as well.
                                       proxy.setProperty(propertyName, propertyObject.value);
                                       return;
                                  // Disable the option to manually enter a value once the component is bound.
                                  dataInsertEditor.enabled = false;
                                  // Display the range address.
                                  dataInsertEditor.text = proxy.getBindingDisplayName(bindingID);
                                  // Excel spreadsheet binding:-
                                  // BindingDirection.INPUT    - update the spreadsheet when the custom component "value" changes.
                                  // InputBindings.ARRAY  - Write to multiple cells in the spreadsheet.
                                  proxy.bind("selectedItem", null, bindingID, BindingDirection.INPUT, InputBindings.SINGLETON, "");
                                  break;
    How would that change if I want to tie it as a binary value to the checkbox's checked/unchecked state?
    Edited by: Owen B on Jun 22, 2008 7:35 PM
    Edited by: Owen B on Jun 23, 2008 2:49 PM

    Hi Owen,
    You should be able to do what you want with the Xcelsius 2008 Component SDK.
    This is the line that sets up the component <--> spreadsheet binding (in this case update the spreadsheet when the component property changes).
    proxy.bind("selectedItem", null, bindingID, BindingDirection.INPUT, InputBindings.SINGLETON, "");
    To change so that the spreadsheet is also updated when the property changes do this instead:
    proxy.bind("selectedItem", null, bindingID, BindingDirection.BOTH, InputBindings.SINGLETON, OutputBindings.SINGLETON);
    Using Number or Boolean for the component property type should then work.
    Regards,
    Matt

  • How to add a field in dynamic selections

    HI,
    There is a requirement in which i need to add a field in existing program of dynamic selections.
    I have added a field in the screen.But I was not able to write the label and is not displaying.
    I ahve copied evrything from existing coding.but still.
    In the program ,Field groups are being used.
    I have inserted my field in that header and item of field groups.
    But i was not able to select the data based on this selection.
    i will attach my code here for reference.
    can anyone please help me how to use these filed symbols.
    If possible send me the document on Dynamic selections.
    the field i need to add is bkpf-bktxt
    TABLES:
      tcurx,
      lfa1,
      kna1,
      bhdgd,
      bkpf,
      bseg,
      bsega,
      b0sg,
      fimsg,
      sarkey,
      t001,
      vbset,
      sscrfields.
          Selektionsparameter                                           *
    begin_of_block 1.
    PARAMETERS:
      par_nbel       LIKE rfpdo-bpetnbel,  "Normale Belege
      par_vbel       LIKE rfpdo-epojvbel,  "Vorerfaßte Belege
      par_sbel       LIKE rfpdo-bpetsbel,  "Statistischen Belege
      par_mbel       LIKE rfpdo-epojmbel,  "Musterbelege
      par_dbel       LIKE rfpdo1-korbdbel. "Dauerbuchungsurbelege
    end_of_block 1.
    begin_of_block 2.
    PARAMETERS:
      par_summ       LIKE rfpdo1-allgsumm, "nur Summenausgabe
      par_hkto       LIKE rfpdo2-beljhkto, "Hauptbuch- statt Personenkonto
      par_altk       LIKE rfpdo1-allgaltk, "alternative Kontonummer
      par_lsep       LIKE rfpdo-allglsep,  "Listseparation
      par_mikf       LIKE rfpdo-allgmikf,  "Mikrofiche-Zeile
      par_line       LIKE rfpdo1-allgline. "Zusatztitel
    Eingaben für optische Archivierung
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS:     arc     LIKE rfpdo1-allgarch.
    SELECTION-SCREEN COMMENT 3(29) text-103 FOR FIELD arc.
    SELECTION-SCREEN POSITION POS_LOW.
    PARAMETERS:     arc_msg1(10) MODIF ID arc.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION POS_LOW.
    PARAMETERS:     arc_msg2(10) MODIF ID arc.
    SELECTION-SCREEN END OF LINE.
    end_of_block 2.
    PARAMETERS:     arc_mem LIKE arc_params NO-DISPLAY.
          Felder und Feldleisten                                        *
    CONSTANTS:
      con_true       TYPE i                VALUE 1,
      con_false      TYPE i                VALUE 2,
      con_hash       TYPE i                VALUE 1,
      con_vendor     TYPE c                VALUE 'K',
      con_cust       TYPE c                VALUE 'D'.
    Global Data
    DATA: BEGIN OF hash_totals OCCURS 25,
             bukrs LIKE t001-bukrs,
             poper(7),
             dramt LIKE bseg-wrbtr,
             cramt LIKE bseg-wrbtr,
          END OF hash_totals.
    DATA:
      factor         TYPE i,
    Zähler
      cnt_bukrs(4)   TYPE p,               "Anzahl Buchungskreise
      cnt_max        LIKE sy-tfill,        "Maximum der CNT_Ti
      cnt_t0         LIKE sy-tfill,        "Anzahl Einträge in Ti
      cnt_t1         LIKE sy-tfill,
      cnt_t2         LIKE sy-tfill,
      cnt_t3         LIKE sy-tfill,
      cnt_t4         LIKE sy-tfill,
      cnt_t5         LIKE sy-tfill,
    Fehler
      err_altkt(1)   TYPE c,               "alt. Kontonummer nicht gefunden
    Flags
      flg_section    TYPE i,
      flg_vendr2     TYPE i,
      flg_vendr3     TYPE i,
      flg_color(1)   TYPE n,               "0 - intensified off
    Hilfsfelder
      hlp_belnr(10)  TYPE c,               "Anzeigefeld Belegnummer
      hlp_bstat      LIKE bkpf-bstat,      "Status vorerfaßter Belege
      hlp_buper(7)   TYPE c,               "Buchungsperiode mit '/'
      hlp_null(1)    TYPE p VALUE 0,       "Betrag Null
      hlp_sakan      LIKE ska1-sakan,      "Anzeigefeld Kontonummer
      hlp_wrshb(26)  TYPE c,               "FW-Betrag mit Währung in Klammer
      hlp_vnd_amt(43) TYPE c,
    Texte
      txt_line0(132) TYPE c,               "Überschriften
      txt_line1(132) TYPE c,
      txt_line2(132) TYPE c,
      txt_line(132)  TYPE c,               "Hilfstext
    Feldleisten
      BEGIN OF mikfi,                      "Information Mikrofiche-Zeile
        bstat        LIKE bkpf-bstat,
        bukrs        LIKE bkpf-bukrs,
        gjahr        LIKE bkpf-gjahr,
        belnr        LIKE bkpf-belnr,
      END OF mikfi.
          Interne Tabellen                                              *
    DATA:
    Belegkopfinformationen
      BEGIN OF t0 OCCURS 4,                "0 - allgemeine Angaben
        info(1)  TYPE n,                   "1 - vorerfaßter Beleg
      END OF t0,                           "2 - Referenz
                                                                "3 - Storno
                                           "4 - gelöschter vorerfaßter Beleg
                                           "5 - ersetzter vorerfaßter Beleg
                                           "6 - Ausgleichsbeleg
                                           "7 - zurückgenommener Ausgleich
    Personenkonteninformationen je Beleg
      BEGIN OF t1 OCCURS 10,
        koart    LIKE bseg-koart,          "Kontoart
        ktonr    LIKE bseg-kunnr,          "Kontonummer(Debitor/Kreditor)
        bschl    LIKE bseg-bschl,          "Buchungsschlüssel
        xnegp    LIKE bseg-xnegp,          "Negativbuchung
        umskz    LIKE bseg-umskz,          "Sonderumsatzkennzeichen
        zlspr    LIKE bseg-zlspr,          "Payment Block Key - CR 21709
        dmshb    LIKE bsega-dmshb,         "Soll-Haben Betrag in Hauswährung
        wrshb    LIKE bsega-dmshb,         "Betrag in Fremdwährung
        xfwae(1) TYPE c,                   "X - Fremdwährungsinformation
        name1    LIKE lfa1-name1,          "Customer/ Vendor Name
      END OF t1,
    Steuerinformationen je Beleg
      BEGIN OF t2 OCCURS 10,
        mwskz    LIKE bseg-mwskz,          "Mehrwertsteuerkennzeichen
        dmshb    LIKE bsega-dmshb,         "Soll-Haben Betrag in Hauswährung
      END OF t2,
    Sachkonteninformationen je Beleg
      BEGIN OF t3 OCCURS 20,
        mwskz    LIKE bseg-mwskz,          "Mehrwertsteuerkennzeichen
        bschl    LIKE bseg-bschl,          "Buchungsschlüssel
        xnegp    LIKE bseg-xnegp,          "Negativbuchung
        koart    LIKE bseg-koart,          "Kontoart
        hkont    LIKE bseg-hkont,          "Hauptbuchkonto
        dmshb    LIKE bsega-dmshb,         "Soll-Haben Betrag in Hauswährung
        kostl    LIKE bseg-kostl,          "Cost Center
        prctr    LIKE bseg-prctr,          "Profit Center
      END OF t3,
    Sonderhauptbuchbeträge für Debitoren (nur Ausgabe)
      BEGIN OF t4 OCCURS 5,
        umskz         LIKE bseg-umskz,     "Sonderumsatzkennzeichen
        dmsol(9)      TYPE p,              "Soll-Betrag Hauswährung
        dmhab(9)      TYPE p,              "Haben-Betrag Hauswährung
      END OF t4,
    Sonderhauptbuchbeträge für Kreditoren (nur Ausgabe)
      BEGIN OF t5 OCCURS 5,
        umskz         LIKE bseg-umskz,     "Sonderumsatzkennzeichen
        dmsol(9)      TYPE p,              "Soll-Betrag Hauswährung
        dmhab(9)      TYPE p,              "Haben-Betrag Hauswährung
      END OF t5,
    Summeninformationen je Buchungskreis
      BEGIN OF tbukrs OCCURS 20,
        bstat         LIKE bkpf-bstat,     "Belegstatus
        bukrs         LIKE bkpf-bukrs,     "Buchungskreis
    START OF CHANGE FOR CR63816 by OS0794 on 01/29/2008
        bktxt         LIKE bkpf-bktxt,
    END OF CHANGE FOR CR63816 by OS0794 on 01/29/2008
        gjahr         LIKE bkpf-gjahr,     "Buchungsjahr
        monat         LIKE bkpf-monat,     "Buchungsmonat
        dmsol(9)      TYPE p,              "Soll-Betrag Hauswährung
        dmhab(9)      TYPE p,              "Haben-Betrag Hauswährung
        waers         LIKE t001-waers,     "Währungsschlüssel (nur Ausgabe)
      END OF tbukrs,
    Sonderhauptbuchinformationen je Buchungskreis
      BEGIN OF tbukrs_u OCCURS 20,
        bstat         LIKE bkpf-bstat,     "Belegstatus
        bukrs         LIKE bkpf-bukrs,     "Buchungskreis
    START OF CHANGE FOR CR63816 by OS0794 on 01/29/2008
        bktxt         LIKE bkpf-bktxt,
    END OF CHANGE FOR CR63816 by OS0794 on 01/29/2008
        gjahr         LIKE bkpf-gjahr,     "Buchungsjahr
        monat         LIKE bkpf-monat,     "Buchungsmonat
        koart         LIKE bseg-koart,     "Kontoart
        umskz         LIKE bseg-umskz,     "Sonderumsatzkennzeichen
        dmsol(9)      TYPE p,              "Soll-Betrag Hauswährung
        dmhab(9)      TYPE p,              "Haben-Betrag Hauswährung
        waers         LIKE t001-waers,     "Währungsschlüssel (nur Ausgabe)
      END OF tbukrs_u,
    Summeninformationen je Hauswährung
      BEGIN OF twaers OCCURS 10,
        bstat         LIKE bkpf-bstat,     "Belegstatus
        waers         LIKE t001-waers,     "Hauswährungsschlüssel
        gjahr         LIKE bkpf-gjahr,     "Buchungsjahr
        monat         LIKE bkpf-monat,     "Buchungsmonat
        dmsol(9)      TYPE p,              "Soll-Betrag Hauswährung
        dmhab(9)      TYPE p,              "Haben-Betrag Hauswährung
      END OF twaers,
    Sonderhauptbuchinformationen je Hauswährung
      BEGIN OF twaers_u OCCURS 20,
        bstat         LIKE bkpf-bstat,     "Belegstatus
        waers         LIKE t001-waers,     "Währungsschlüssel
        gjahr         LIKE bkpf-gjahr,     "Buchungsjahr
        monat         LIKE bkpf-monat,     "Buchungsmonat
        koart         LIKE bseg-koart,     "Kontoart
        umskz         LIKE bseg-umskz,     "Sonderumsatzkennzeichen
        dmsol(9)      TYPE p,              "Soll-Betrag Hauswährung
        dmhab(9)      TYPE p,              "Haben-Betrag Hauswährung
      END OF twaers_u,
    Fehlerprotokoll im Batch
      BEGIN OF tfimsg OCCURS 10.
            INCLUDE STRUCTURE fimsg.
    DATA END OF tfimsg.
          Strukturen für optische Archivierung                          *
    DATA BEGIN OF info OCCURS 10.
            INCLUDE STRUCTURE bhinf.
    DATA END OF info.
    DATA:
      arc_save LIKE arc_params,
      arc_valid.
          Feldgruppen                                                   *
    FIELD-GROUPS: header, daten.
    INSERT:
      bkpf-bukrs                           "Buchungskreis
      bkpf-bktxt                           "Change by OS0794
      bkpf-bstat                           "Belegstatus
      bkpf-gjahr                           "Geschäftsjahr
      bkpf-belnr                           "Belegnummer
      bseg-buzei                           "Buchungszeile
    INTO header.
    INSERT
      bkpf-blart                           "Belegart
      bkpf-bktxt                           "Change by OS0794
      bkpf-budat                           "Buchungsdatum
      bkpf-stblg                           "Stornobelegnummer
      bkpf-waers                           "Währungsschlüssel
      bkpf-xblnr                           "Referenzangabe
      bseg-bschl                           "Buchungsschlüssel
      bseg-xnegp                           "Negativbuchung
      bseg-zlspr                           "Payment Block Key - CR 21709
      bseg-hkont                           "Hauptbuchkonto
      bseg-koart                           "Kontoart
      bseg-kunnr                           "Debitornummer
      bseg-lifnr                           "Kreditornummer
      bseg-mwart                           "Mehrwertsteuerart (A oder V)
      bseg-mwskz                           "Mehrwertsteuerkennzeichen
      bseg-umskz                           "Sonderhauptbuch-Kennzeichen
      bsega-dmshb                          "S/H-Betrag in Hauswährung
      bsega-mdshb                          "Umsatzsteuerbetrag in Hauswährg
      bsega-wrshb                          "S/H-Betrag in Fremdwährung
      hlp_bstat                            "Status vorerfaßter Belege bzw.
      bseg-kostl
      bseg-prctr
      bkpf-monat
    INTO daten.                            "Status von Belegen ohne Zeilen
          Vorschlagswerte                                               *
    INITIALIZATION.
      get_frame_title: 1,2.
      par_nbel = 'X'.
      par_sbel = space.
      par_mbel = space.
      par_dbel = space.
      par_vbel = 'X'.
          Archivinformationen nur fuer Ausgabe                          *
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-group1 = 'ARC'.
          screen-input = '0'.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
          Prüfung und Korrektur der eingegebenen Daten                  *
    AT SELECTION-SCREEN ON arc.
      IF arc <> ' ' AND arc_mem(20) = space.
        CALL FUNCTION 'GET_ARCHIVE_PARAMETERS'
          EXPORTING
            in_parameters  = arc_save
            printer        = '    '
          IMPORTING
            out_parameters = arc_mem
            valid          = arc_valid
          EXCEPTIONS
            OTHERS         = 04.
        IF arc_valid <> 'X' OR arc_mem = space.
          CLEAR arc_mem.
          MESSAGE e999 WITH text-102.
        ENDIF.
        arc_msg1 = arc_mem(10).
        arc_msg2 = arc_mem+10(10).
      ENDIF.
      IF arc = ' '.
        CLEAR arc_mem.
        arc_msg1 = arc_msg2 = space.
      ENDIF.
      arc_save = arc_mem.
    AT SELECTION-SCREEN ON arc_msg1.
      arc_msg1 = arc_mem(10).
    AT SELECTION-SCREEN ON arc_msg2.
      arc_msg2 = arc_mem+10(10).
    AT SELECTION-SCREEN.
      IF par_nbel EQ space AND
         par_mbel EQ space AND
         par_dbel EQ space AND
         par_sbel EQ space AND
         par_vbel EQ space.
        SET CURSOR FIELD 'PAR_NBEL'.
        MESSAGE e111.
      ENDIF.
    optische Archivierung
      IF arc <> ' ' AND par_mikf <> ' '.
        CLEAR arc_mem.
        MESSAGE e999 WITH text-100.
      ENDIF.
      IF arc <> ' ' AND par_lsep <> ' '.
        CLEAR arc_mem.
        MESSAGE e999 WITH text-101.
      ENDIF.
      IF arc = 'X' AND sscrfields-ucomm = 'PRIN'.
        sscrfields-ucomm = 'ONLI'.
        sy-pdest = 'LP01'.                 "wegen Abfrage in Batch-Heading
      ENDIF.
          Vorbelegungen                                                 *
    START-OF-SELECTION.
      bhdgd-lines = sy-linsz.
      bhdgd-repid = sy-repid.
      bhdgd-uname = sy-uname.
      bhdgd-separ = par_lsep.
      bhdgd-domai = 'BUKRS'.
      IF arc = 'X'.
        bhdgd-miffl = 'A'.
      ENDIF.
      IF par_mikf = 'X'.
        bhdgd-miffl = 'X'.
      ENDIF.
    Initialisierung für optisches Archiv
      PERFORM open_archive(rsbtchh0) USING arc_mem.
      info-name = 'BKPF-BSTAT'. info-len = space. APPEND info.
      info-name = 'BKPF-BUKRS'. info-len = space. APPEND info.
      info-name = 'BSEG-GJAHR'. info-len = space. APPEND info.
      info-name = 'BKPF-BELNR'. info-len = space. APPEND info.
      info-name = 'BKPF-BKTXT'. info-len = space. APPEND info.
      PERFORM start_archive(rsbtchh0) TABLES info.
      b0sg-xstan = par_nbel.
      b0sg-xstam = par_mbel.
      b0sg-xstad = par_dbel.
      b0sg-xstas = par_sbel.
      b0sg-xstaa = 'X'.
      IF par_vbel EQ 'X'.
        b0sg-xstav = 'Z'.
      ENDIF.
          Selektion                                                     *
    GET bkpf FIELDS blart bstat budat monat stblg waers xblnr bktxt.
      CLEAR hlp_bstat.
      IF 'ABVWZ' CA bkpf-bstat.
        hlp_bstat = bkpf-bstat.
        CLEAR bkpf-bstat.
        IF 'ABWZ' CA hlp_bstat.
          CLEAR: bseg, bsega.
          IF par_summ EQ space.
            EXTRACT daten.
          ENDIF.
          PERFORM summe_merken.
        ENDIF.
      ENDIF.
    GET bseg.
      IF par_summ EQ space.
        EXTRACT daten.
      ENDIF.
      PERFORM summe_merken.
    GET bkpf LATE.
      PERFORM vorerfasste_steuer_merken.
          Seitenkopf                                                    *
    TOP-OF-PAGE.
      PERFORM batch-heading(rsbtchh0).
      ULINE.
      IF flg_section <> con_hash.
        FORMAT COLOR 1 INTENSIFIED OFF.
        WRITE    / txt_line0.
        ULINE.
        FORMAT COLOR 1 INTENSIFIED.
        WRITE:   / txt_line1,
                 / txt_line2.
      ELSE.
        FORMAT COLOR 1 INTENSIFIED OFF.
        WRITE: / sy-vline NO-GAP,
                 'Hash Totals'(205),
           132   sy-vline.
        ULINE.
        FORMAT COLOR 1 INTENSIFIED.
        WRITE:   /     sy-vline NO-GAP,
                  (10) 'CoCd'(200),
                  (07) 'Period'(201),
                       sy-vline,
                  (16) 'Debit Amount'(202),
                  (16) 'Credit Amount'(203),
                       sy-vline,
                  (16) 'Total'(204).
      ENDIF.
      ULINE.
          Sortieren der Daten                                           *
    END-OF-SELECTION.
      DESCRIBE TABLE tbukrs LINES sy-tfill.
      IF sy-tfill EQ 0.
        CALL FUNCTION 'POPUP_NO_LIST'.
      ENDIF.
      SORT.
      SORT tbukrs.
          Belegjournal                                                  *
      LOOP.
    *-- Neuer Buchungskreis -
        AT NEW bkpf-bukrs.
          SELECT SINGLE * FROM t001 WHERE bukrs EQ bkpf-bukrs.
          IF sy-subrc NE 0.
            IF sy-batch EQ space.
              MESSAGE a101 WITH bkpf-bukrs.
            ELSE.
              MESSAGE s101 WITH bkpf-bukrs.
              STOP.
            ENDIF.
          ENDIF.
          bhdgd-bukrs = bkpf-bukrs.
          bhdgd-werte = bkpf-bukrs.
          PERFORM new-section(rsbtchh0).
          PERFORM titel_fuellen USING '5'.
        ENDAT.
    *-- Neuer Belegstatus -
        AT NEW bkpf-bstat.
          PERFORM new_page USING bkpf-bstat.
          flg_color = 1.
        ENDAT.
    *-- Neue Belegnummer -
        AT NEW bkpf-belnr.
          REFRESH: t0, t1, t2, t3.
          PERFORM belegkopf_merken.
          mikfi-bstat = bkpf-bstat.
          mikfi-bukrs = bkpf-bukrs.
          mikfi-gjahr = bkpf-gjahr.
          mikfi-belnr = bkpf-belnr.
          bhdgd-grpin = mikfi.
        ENDAT.
    *-- Belegzeile -
        PERFORM belegzeile_merken.
    *-- Ende einer Belegnummer -
        AT END OF bkpf-belnr.
          PERFORM beleg_schreiben.
          ULINE.
        ENDAT.
    *-- Ende eines Buchungskreises -
        AT END OF bkpf-bukrs.
          PERFORM titel_fuellen USING '4'.
          PERFORM buchungskreis_schreiben USING bkpf-bukrs.
        ENDAT.
      ENDLOOP.
          Summenblätter                                                 *
      bhdgd-bukrs = '    '.
      bhdgd-werte = '    '.
      PERFORM new-section(rsbtchh0).
      PERFORM titel_fuellen USING '4'.
      PERFORM buchungskreis_schreiben USING '    '.
      PERFORM hauswaehrung_schreiben.
          Print Hash Totals                                             *
      flg_section = con_hash.
      NEW-PAGE.
      PERFORM prt_hash TABLES hash_totals.
          Fehlerprotokoll                                               *
      CALL FUNCTION 'FI_MESSAGE_CHECK'
        EXCEPTIONS
          no_message = 4.
      IF sy-subrc = 0.
        IF sy-batch EQ space.
          PERFORM titel_fuellen USING '6'.
          NEW-PAGE.
          FORMAT COLOR 6 INTENSIFIED.
          CALL FUNCTION 'FI_MESSAGE_SORT'.
          CALL FUNCTION 'FI_MESSAGE_PRINT'
            EXPORTING
              i_xskip = 'X'.
        ELSE.
          CALL FUNCTION 'FI_MESSAGE_GET'
            TABLES
              t_fimsg = tfimsg.
          LOOP AT tfimsg.
            MESSAGE ID tfimsg-msgid TYPE tfimsg-msgty NUMBER tfimsg-msgno
              WITH tfimsg-msgv1 tfimsg-msgv2 tfimsg-msgv3 tfimsg-msgv4.
          ENDLOOP.
        ENDIF.
      ENDIF.
           U N T E R P R O G R A M M E                                  *
                0. TITEL_FUELLEN                                        *
                1. NEW_PAGE                                             *
                2. SUMME_MERKEN                                         *
                3. VORERFASSTE_STEUER_MERKEN                            *
                4. BELEGKOPF_MERKEN                                     *
                5. BELEGZEILE_MERKEN                                    *
                6. BELEG_SCHREIBEN                                      *
                7. BUCHUNGSKREIS_SCHREIBEN                              *
                8. HAUSWAEHRUNG_SCHREIBEN                               *
                9. SUMMENZEILE_SCHREIBEN                                *
               10. KONTONUMMER                                          *
    0.   FORM TITEL_FUELLEN                                            *
          Ersetzt das Global &CCCU durch die Buchungskreiswährung       *
          F00_TEXT ist 4, 5 oder 6, je nach Gruppe der Textelemente     *
    FORM titel_fuellen USING f00_text.
      DATA:
        BEGIN OF txt_502,
         T1(49) TYPE C, "CR 21709
         W1(23) TYPE C, "CR 21709
          t1(50) TYPE c,                                        "CR 21709
          w1(22) TYPE c,                                        "CR 21709
          t2(6)  TYPE c,
          w2(15) TYPE c,
          t3(21) TYPE c,
          w3(16) TYPE c,
          t4(2)  TYPE c,
        END OF txt_502.
      CASE f00_text.                       "Textelemente
        WHEN '4'.                          "- für die Summenliste
          txt_line0 = text-400.
          txt_line1 = text-401.
          txt_line2 = text-402.
        WHEN '5'.                          "- für die Einzelpostenliste
          txt_line0 = text-500.
          txt_line1 = text-501.
          txt_line2 = text-502.
          IF par_hkto EQ 'X'.
            txt_line1+33(10) = text-505.
            txt_line2+33(10) = text-506.
          ENDIF.
          txt_502   = txt_line2.
          REPLACE '&CCCU' WITH t001-waers INTO:
            txt_502-w1, txt_502-w2, txt_502-w3.
          CONDENSE:
            txt_502-w1, txt_502-w2, txt_502-w3.
          WRITE:
            txt_502-w1 TO txt_502-w1 RIGHT-JUSTIFIED,
            txt_502-w2 TO txt_502-w2 RIGHT-JUSTIFIED,
            txt_502-w3 TO txt_502-w3 RIGHT-JUSTIFIED.
          txt_line2 = txt_502.
        WHEN '6'.                          "- für die Fehlerliste
          txt_line0 = text-600.
          txt_line1 = text-601.
          txt_line2 = space.
        WHEN OTHERS.                       "- initialisieren
          txt_line0 = space.
          txt_line1 = space.
          txt_line2 = space.
      ENDCASE.
    ENDFORM.                    "TITEL_FUELLEN
    1.   FORM NEW_PAGE                                                 *
          Initialisierungen für BATCH-HEADING Routine                   *
          F01_BSTAT steuert den Aufbau des Reporttitels                 *
    FORM new_page USING f01_bstat.
      CASE f01_bstat.                      "Reporttitel
        WHEN 'D'.                          "- für Dauerbuchungsurbelege
          bhdgd-line1 = text-001.
        WHEN 'M'.                          "- für Musterbelege
          bhdgd-line1 = text-002.
        WHEN 'S'.                          "- für statistische Belege
          bhdgd-line1 = text-003.
        WHEN OTHERS.                       "- für normale/vorerfaßte Belege
          bhdgd-line1 = sy-title.
      ENDCASE.
      bhdgd-line2 = par_line.
      bhdgd-inifl = 0.
      NEW-PAGE.
    ENDFORM.                    "NEW_PAGE
    2.   FORM SUMME_MERKEN                                             *
          Merken der Summeninformation                                  *
    FORM summe_merken.
      CLEAR tbukrs.
      tbukrs-bstat = bkpf-bstat.
      tbukrs-bukrs = bkpf-bukrs.
      tbukrs-bktxt = bkpf-bktxt.
      tbukrs-gjahr = bkpf-gjahr.
      tbukrs-monat = bkpf-monat.
      tbukrs-dmsol = bsega-dmsol.
      tbukrs-dmhab = bsega-dmhab.
      IF 'DK' CA bseg-koart.
        MOVE-CORRESPONDING tbukrs TO tbukrs_u.
        tbukrs_u-koart   = bseg-koart.
        tbukrs_u-umskz   = bseg-umskz.
        tbukrs_u-dmsol   = bsega-dmsol.
        tbukrs_u-dmhab   = bsega-dmhab.
        COLLECT tbukrs_u.
        tbukrs_u-monat   = 0.              "Summe für das Geschäftsjahr
        COLLECT tbukrs_u.
      ENDIF.
      COLLECT tbukrs.
    ENDFORM.                    "SUMME_MERKEN
    3.   FORM VORERFASSTE_STEUER_MERKEN                                *
          Nachlesen der Steuerzeilen vorerfaßter Belege                 *
          Gefüllt wird TBUKRS und der Extrakt                           *
    FORM vorerfasste_steuer_merken.
      CHECK hlp_bstat EQ 'V'.
      SELECT * FROM vbset
        WHERE ausbk EQ bkpf-bukrs
          AND belnr EQ bkpf-belnr
          AND gjahr EQ bkpf-gjahr.
        CHECK vbset-hwste NE 0.
        CLEAR: bseg, bsega.
        bseg-koart    = 'S'.
        bseg-mwart    = 'V'.               "oder 'A', nur zum Füllen von T2
        bseg-mwskz    = vbset-mwskz.
        IF vbset-shkzg EQ 'S'.
          bsega-dmsol = vbset-hwste.
          bsega-dmshb = vbset-hwste.
        ELSE.
          bsega-dmhab = vbset-hwste.
          bsega-dmshb = - vbset-hwste.
        ENDIF.
        IF par_summ EQ space.
          EXTRACT daten.
        ENDIF.
        PERFORM summe_merken.
      ENDSELECT.
    ENDFORM.                    "VORERFASSTE_STEUER_MERKEN
    4.   FORM BELEGKOPF_MERKEN                                         *
          Je Beleg werden gefüllt:                                      *
          T0 - Informationsflag                                         *
    FORM belegkopf_merken.
      t0-info = 0.                         "Belegkopf
      APPEND t0.
      CASE hlp_bstat.
        WHEN 'A'.
          t0-info = 6.                     "Ausgleichsbeleg
          APPEND t0.
        WHEN 'B'.
          t0-info = 7.                     "zurückgen. Ausgleichsbeleg
          APPEND t0.
        WHEN 'V'.
          t0-info = 1.                     "vorerfaßter Beleg
          APPEND t0.
        WHEN 'W'.
          t0-info = 5.                     "ersetzter vorerfaßter Beleg
          APPEND t0.
        WHEN 'Z'.
          t0-info = 4.                     "gelöschter vorerfaßter Beleg
          APPEND t0.
      ENDCASE.
      IF bkpf-xblnr NE space AND hlp_bstat NA 'BWZ'.
        t0-info = 2.                       "Referenz
        APPEND t0.
      ENDIF.
      IF bkpf-stblg NE space.
        t0-info = 3.                       "Storno
        APPEND t0.
      ENDIF.
      SORT t0.
    ENDFORM.                    "BELEGKOPF_MERKEN
    5.   FORM BELEGZEILE_MERKEN                                        *
          Je Beleg werden gefüllt:                                      *
          T1 - Personenkonteninformation                                *
          T2 - Steuerinformation (nicht bei vorerfaßten Belegen)        *
          T3 - Sachkonteninformation                                    *
    FORM belegzeile_merken.
    Vendors/ Customers
      IF bseg-koart CA 'DK'.
        t1-koart   = bseg-koart.
        IF par_hkto EQ 'X'.
          t1-ktonr = bseg-hkont.
        ELSEIF bseg-koart EQ 'K'.
          t1-ktonr = bseg-lifnr.
        ELSE.
          t1-ktonr = bseg-kunnr.
        ENDIF.
        t1-bschl   = bseg-bschl.
        t1-umskz   = bseg-umskz.
        t1-xnegp   = bseg-xnegp.
        t1-zlspr   = bseg-zlspr.                                "CR 21709
        t1-dmshb   = bsega-dmshb.
        t1-wrshb   = bsega-wrshb.
        t1-xfwae   = space.
        APPEND t1.
      Read the vendor description.
        IF bseg-koart = con_vendor.
          flg_vendr2 = con_true.
          flg_vendr3 = con_true.
          CLEAR lfa1-name1.
          SELECT SINGLE name1
          INTO   lfa1-name1
          FROM   lfa1
          WHERE  lifnr = bseg-lifnr.
        ELSEIF bseg-koart = con_cust.
          CLEAR kna1-name1.
          SELECT SINGLE name1
          INTO   kna1-name1
          FROM   kna1
          WHERE  kunnr = bseg-kunnr.
        ENDIF.
        IF bkpf-waers EQ t001-waers.
          CLEAR t1.
        ENDIF.
        t1-xfwae = 'X'.
        t1-name1 = lfa1-name1.
        IF t1-name1 IS INITIAL.
          t1-name1 = kna1-name1.
        ENDIF.
        APPEND t1.
        CLEAR:
           kna1-name1,
           lfa1-name1.
        CLEAR t1.
      Save the hash total amounts
        CLEAR tcurx-currdec.
        SELECT SINGLE currdec
        INTO   tcurx-currdec
        FROM   tcurx
        WHERE  currkey = bkpf-waers.
        IF tcurx-currdec = 1.
          factor = 10.
        ELSE.
          factor = 100.
        ENDIF.
        CLEAR hash_totals.
        hash_totals-bukrs = bkpf-bukrs.
        CONCATENATE bkpf-monat '/' bkpf-gjahr INTO hash_totals-poper.
        IF bsega-wrshb < 0.
          hash_totals-cramt = bsega-wrshb * factor.
        ELSE.
          hash_totals-dramt = bsega-wrshb * factor.
        ENDIF.
        COLLECT hash_totals.
    Tax accounts
      ELSEIF bseg-mwart CA 'AV'.
        t2-mwskz   = bseg-mwskz.
        t2-dmshb   = bsega-dmshb.
        APPEND t2.
        IF flg_vendr2 = con_true.
          flg_vendr2 = con_false.
          CLEAR t2.
          APPEND t2.
        ENDIF.
    GL Accounts
      ELSEIF hlp_bstat NA 'ABWZ'.
        t3-mwskz   = bseg-mwskz.
        t3-bschl   = bseg-bschl.
        t3-xnegp   = bseg-xnegp.
        t3-koart   = bseg-koart.
        t3-hkont   = bseg-hkont.
        t3-dmshb   = bsega-dmshb.
        APPEND t3.
        IF flg_vendr3 = con_true
        OR NOT bseg-kostl IS INITIAL
        OR NOT bseg-prctr IS INITIAL.
          flg_vendr3 = con_false.
          CLEAR t3.
          t3-kostl = bseg-kostl.
          t3-prctr = bseg-prctr.
          APPEND t3.
          CLEAR t3.
        ENDIF.
      ENDIF.
    ENDFORM.                    "BELEGZEILE_MERKEN
    6.   FORM BELEG_SCHREIBEN                                          *
          Ausgabe der Belginformationen                                 *
    FORM beleg_schreiben.
      DATA:
         len TYPE i.
    Berechnung der benötigten Zeilen pro Beleg
      DESCRIBE TABLE:
        t0 LINES cnt_t0,
        t1 LINES cnt_t1,
        t2 LINES cnt_t2,
        t3 LINES cnt_t3.
      cnt_max = cnt_t0.
      IF cnt_max LT cnt_t1.
        cnt_max = cnt_t1.
      ENDIF.
      IF cnt_max LT cnt_t2.
        cnt_max = cnt_t2.
      ENDIF.
      IF cnt_max LT cnt_t3.
        cnt_max = cnt_t3.
      ENDIF.
      ADD 1 TO cnt_max.
      IF cnt_max LE 10.
        RESERVE cnt_max LINES.
      ELSE.
        RESERVE 5 LINES.
      ENDIF.
      SUBTRACT 1 FROM cnt_max.
    Farbe setzen
      IF flg_color EQ 0.
        FORMAT COLOR 2 INTENSIFIED OFF.
        flg_color = 1.
      ELSE.
        FORMAT COLOR 2 INTENSIFIED.
        flg_color = 0.
      ENDIF.
    Index fuer optische Archivierung
      PERFORM new-group(rsbtchh0).
      DO cnt_max TIMES.
      Belegkopfinformationen
        WRITE     /1 sy-vline NO-GAP.
        IF sy-index LE cnt_t0.
          READ TABLE t0 INDEX sy-index.
          CASE t0-info.
            WHEN 0.                        "Belegkopf
              hlp_belnr = bkpf-belnr.      "Belegnr. mit führenden Nullen
            Referenz auf Originalbeleg
              PERFORM start_doc_reference(rsbtchh0)
                USING bkpf-bukrs bkpf-belnr bkpf-gjahr bkpf-bktxt. " change*
              WRITE:
                     bkpf-bukrs,
                     hlp_belnr,
                     bkpf-blart,
                     bkpf-budat DD/MM/YYYY.
            Ende der Referenz auf Originalbeleg
              PERFORM end_doc_reference(rsbtchh0).
            WHEN 1.                        "Vorerfaßter Beleg
              WRITE:
                (29) text-507.
            WHEN 2.                        "Referenz
              WRITE:
                (12) text-503,
                     bkpf-xblnr.
            WHEN 3.                        "Storno
              WRITE:
                (12) text-504,
                     bkpf-stblg.
            WHEN 4.                        "Gelöschter vorerfaßter Beleg
              WRITE:
                (29) text-507,
                (40) text-508.
            WHEN 5.                        "Ersetzter vorerfaßter Beleg
              txt_line = text-509.
              REPLACE:
                '&BLN' WITH bkpf-xblnr(10) INTO txt_line,
                '&GJR' WITH bkpf-xblnr+10  INTO txt_line.
              WRITE:
                (29) text-507,
                (40) txt_line.
            WHEN 6.                        "Ausgleichsbeleg
              WRITE:                       "
                (29) text-510.             "
            WHEN 7.                        "zurückgen. Ausgleichsbeleg
              WRITE:                       "
                (29) text-511.             "
          ENDCASE.
        ENDIF.
      Personenkonteninformationen
      Subledger Account Information
        WRITE  31(1) sy-vline NO-GAP.
      Internal tables T0 - T5 hold data for each section.
        IF sy-index LE cnt_t1.
          READ TABLE t1 INDEX sy-index.
          IF par_hkto EQ 'X'.
            PERFORM kontonummer USING t1-ktonr hlp_sakan.
          ELSE.
            hlp_sakan = t1-ktonr.
          ENDIF.
          IF t1-xfwae EQ space.
            IF t1-xnegp = 'X'.
              t1-xnegp = '-'.
            ENDIF.
          Write the vendor number.
            WRITE:   t1-koart,
                     hlp_sakan,
                     t1-bschl NO-GAP.
            IF t1-umskz IS INITIAL.
              WRITE:    t1-xnegp NO-GAP,
                        t1-umskz.
            ELSE.
              WRITE:    t1-umskz NO-GAP,
                        t1-xnegp.
            ENDIF.
            WRITE: t1-zlspr. "CR 21709 / 23588
            WRITE: (22) t1-dmshb CURRENCY t001-waers.
          ELSE.
          Write the document currency, amount and the
          vendor/ customer

    Hi,
    Please see documentation of enhancement MM06E005 (transaction SMOD).          
    Userexit EXIT_SAPMM06E_016 is a component of enhancement MM06E005.            
    With that enhancement, you can                                                
      -   Maintain/supply your own customer fields                                
      -   Update your own customer-specific tables                                
    You cannot:                                                                   
      -   Change standard fields                                                  
      -   Change data that depends on the document header in the items            
      -   Change data that depends on an item in the document header                                                                               
    Please have a look at Business Add-In (BAdI) ME_PROCESS_PO_CUST.              
    Regards,
    Edit

  • Dynamic Selection on report not working

    Dear all,
    I have several reports on which the dynamic selection is not working. For instance, the report CN43N. The report is outputting all data in a year i.e it is disregarding the condition I specified in the dynamic selection fields.
    Is there some configuration to make to this report so that the dynamic selection works?
    Thanks for ur help.
    Nas

    Also Nelmaz,
    I have just checked OSS notes and found below note helpful to you:
    Note 1059465 - CN43N: Dynamic selections for scheduling data of WBS elemnts
    Symptom
    You cannot use transaction CN43N to create dynamic selections for scheduling data of WBS elements (table PRTE). You can use transaction CNS43 to do so.
    Hope this helps.
    Please assign points as way to say thanks

  • Adding of new field in dynamic selection for financial statements

    Hi ALL,
    I want to add Trading partner in dynamic selection fields of financial statement report at document level not yet GL master level: S_ALR_87012284 - Balance Sheet / Profit and Loss Statement .
    Can any one tell how to proceed?
    I have referred notes: Note 188663 - Enhancing selection views and dynamic selection.
    But exactly I am unable to find which logical database has to be given?
    regs,
    ramesh b

    Hi,
    If you want to add extra field in your report you can do the setting in Layout selection. If it is not available kinldy check any SAP notes available or not. Otherwise do Zreport with your ABAPer.
    Regards,
    Mohan.

  • How to use dynamic selection screen inputs in main program

    hi all,
      its a report where in it calls one dynamic selection screen( user need to enter the parameters here) after that i need to use those inputs for some check, can any buddy help how to use/ get that input parameters into main program.
    regards,
    vara..

    Hi,
    i think u have created that dynamic selection screen in seperate program and calling to ur main program.instead of that u just create that synamic selection screen program as include program and include it in ur main program.
    or u need to use set/get parameter id concept.
    rgds,
    bharat.

  • How to retrieve values from Dynamic Selection screen while using LDB  - PSJ

    I am having problem in PSJ Logical database. In a custom report which is using PSJ LDB, we are using PROJ and PRPS_R tables.
    When I run program it displays one dynamic selection screen, there we are giving selection criteria for PRPS (Master data WBS element) - Created on (giving some range like 2011/01/01 to 2011/01/31).
    So I want to display all WBS element which are created during the period (2011/01/01 - 2011/01/31).
    How do I retrieve the select-option low and high value of the field Created on Of WBS element if we Select data from any table based on this condition.
               Please help me.
    Thanks.

    in fact you don't have to get the values, you only need to tell to the program to take them into account :
    GET PRPS.
      CHECK SELECT-OPTIONS.

  • How to get dynamic select options from logical database?

    Hi,
    in one of my extended reports (means - overwritten standard SAP functionality in Z-namespace) I'm using LDB 'DDF'. I've been requested to validate some of the dynamic selection options (for example - field HKONT at Document level) and to split the logic depending on the particular value(s).
    Tracking what is happened in the LDB program I found that this select option is added as dynamic WHERE clause to the SELECT statement - in a way:
    WHERE bukrs = p_burks AND ... AND
    (where_tab)
    Is there a way to get values of these LDB dynamic select options into my report and if yes - how?
    Thanks in advance.
    Regards,
    Ivaylo Mutafchiev
    Senior SAP Abap Consultant

    Hi,
    Try to use the following fm in your report and check
      call function 'RS_REFRESH_FROM_DYNAMICAL_SEL'
        exporting
          curr_report        = sy-cprog
          mode_write_or_move = 'M'
        importing
          p_trange           = gt_dyn_trange
        exceptions
          not_found          = 1
          wrong_type         = 2
          others             = 3.
    PS please make a whereused of this fm , how it has been used in LDB's to get dynmic selection values

  • Dynamic selections in Report category

    I am trying to create a dynamic selection view for a report category, while doing so i am not able to add any table to table dialog that appears, when i enter PA0001 it says PA0001 is not a table. Same problem for any table i try to insert.
    Can anyone help me with a solution.
    Thanks in advance.

    In transaction SE80, i selected "edit object" button -> in the screen that pops-up i selected the tab "more"
    In that tab i selected radio button "Selection View" and then selected create button
    Then  "Create Selection View" screen appears, there i selected CUS View, checked radio button "for any tables" and gave a name of view 'ZTEST' and pressed the continue button, A screen appears to enter tables, when i enter any table it gives the message Table not found.
    When i try in other systems it works, not sure of the problem in our dev system.
    Thanks,
    Thirumal

  • Addition of field for Dynamic Selection in TCode FBL1N

    Hi,
    We have a requirement to add the field Partner Bank Type in TCode FBL1N on clicking dynamic selection button (under vendor master) in TCode FBL1N. To achieve this we went to TCode SE36 (Logical database) and selected logical databse KDF and then seleted selection views from the extras menu. There we have selected the table LFBK and then entered 01 (function group for Vendor Master) in the box next to the field BVTYP and selected the checbox on the right of BVTYP to enable Preselection. Saved the changes.
    However the field  Partner Bank Type does not show in the dynamic selection in TCode FBL1N under Vendor Master. Please help.
    Thanks in advance.
    Mick

    Thanks Miguel.
    I found this on the web:
    http://joyjitghosh.blogspot.com/2009/05/how-to-add-new-fields-in-dynamic.html
    I have done exactly as per the instructions given in the above link, but still I am unable to see the field in the dynamic selections of TCode FBL1N. Any reason why and how can we add the field in the dynamic selections?
    Mick

  • Dynamic select using jsp?

    grrrrr............ok so I'm kinda new to this, and just a little frustrated. I'm gonna ramble here, so any time I sound like I don't know what I'm talking about it 's because I don't..correct me. I want to include a bean in a jsp which will buil d a dynamic select box on the fly. That is, connect to an LDAP db and place each value returned in the query in a select box. Now, I can compile and run the bean in my IDE and watch the output in the console. It's correct because I see "<select><option value = hall>hall....</select>". In the buildSelectBox() method I'm using System.out.println to display each line of my select box (is that right?). Now, when I copy the .class file over to the server I was initially getting an error because the bean wasn't found. I resolved that by properly compiling the bean in a package. Problem is that if I call the bean.buildSelect() method in the .jsp nothing comes back. The page is left blank. What in the world is that about? Can someone push me toward a tutorial that can push me in the right direction or sumthin? Why am I having so much trouble with this? Should I be building the select on the jsp?
    regards,
    mat

    Hi!
    If i understand you correctly :-) you are doing not very right things. I don't want it to seem like I'm going to teach you, but:
    The Bean that has buildSelect() method is not a bean at all. Usualy Beans contain getter/setters and accumulate data. If you want to build html code dynamicaly then you should use servlets(Which is not very flexible in your situation, I think), not JSPs. And if you are using JSPs then you have to make Tag which will do this everything.
    Other way is to use Struts framework which is very good and flexible for building web applications - it has it's own tags for many cases. You can make loops in JSPs, use beans and all that stuff.
    Guys will correct me if I missed something.
    Good luck

Maybe you are looking for

  • How to populate the collaboration name field in B2B?

    hello, There a field in oracle B2B 11g console in Reports --> Conversations the Collaboration ID field get populated with the Id just wanted to know how can we populate the Collaboration name ? Regards, Shreya

  • Designing a Double-Sided business card in InDesign

    Hi All I would like to design a double-sided business card using InDesign and I have just downloaded the app. I went to create a new document but there is no option for "US business card" size as it states in the tutorial. Is this because I am using

  • Process for Tank Cleaning

    HI Gurus I need to map process for tank cleaning in process industry. Process requirement:- It is a chemical industry. After a process completion cleaning is required for reactor .For cleaning a different cleaning material is used which depends on pr

  • Pdfs not saving in color

    Hey all, I just upgraded to CS6 and all of a sudden when I'm saving files as PDFs they save as grayscale (no colour). Any idea what's causing this? Please let m know! Thanks in advance. Cheers Jon

  • Where is my Hard Disk space going?

    So basically, something is guzzling up HDD space. I've moved the majority of my stuff onto an external drive with just my music and apps, and fair bit of stuff in my downloads folder left. When looking through what's using up space I found, first, th