Add Multiple records to G/L account group.

Dear ABAP Experts,
i have requirement that is using  BDC recording file  the Functional People wants to add records to the G/L Account group. The FI consultant gave the recording file, based on the recording file i developed a BDC program. This BDC program will work for single record. After creating single record system will ask for transport request .
REPORT  ZDP_ACC_GRP.
TYPES: BEGIN OF TY_TAB,
        KTOPL TYPE KTOPL,
        KTOKS TYPE KTOKS,
        TXT30 TYPE TXT30,
        VONNR TYPE VONNR,
        BISNR TYPE BISNR,
       TRKORR TYPE TRKORR,
   END OF TY_TAB.
data: lt_tab type table of ty_tab,
       wa_tab type ty_tab.
data: begin of record,
* data element: KTOPL
         KTOPL_01_001(004),
* data element: KTOKS
         KTOKS_01_002(004),
* data element: TXT30_077T
         TXT30_01_003(030),
* data element: VONNR_077S
         VONNR_01_004(010),
* data element: BISNR_077S
         BISNR_01_005(010),
* data element: TRKORR
         TRKORR_006(020),
       end of record.
*       Batchinputdata of single transaction
DATA:   BDCDATA type table of BDCDATA  WITH HEADER LINE.
*       messages of call transaction
DATA:   MESSTAB type table of BDCMSGCOLL  WITH HEADER LINE.
*       error session opened (' ' or 'X')
DATA:   E_GROUP_OPENED.
*       message texts
TABLES: T100.
data:lv_file type string.
parameters: p_fname type IBIPPARMS-PATH.
at selection-screen on value-request for p_fname.
CALL FUNCTION 'F4_FILENAME'
  EXPORTING
    PROGRAM_NAME        = SYST-CPROG
    DYNPRO_NUMBER       = SYST-DYNNR
    FIELD_NAME          = 'P_FNAME'
  IMPORTING
    FILE_NAME           = p_fname .
start-of-selection.
lv_file = p_fname.
CALL FUNCTION 'GUI_UPLOAD'
   EXPORTING
     FILENAME                      = LV_FILE
*   FILETYPE                      = 'ASC'
    HAS_FIELD_SEPARATOR           = 'X'
   TABLES
     DATA_TAB                      = LT_TAB
  EXCEPTIONS
    FILE_OPEN_ERROR               = 1
    FILE_READ_ERROR               = 2
    NO_BATCH                      = 3
    GUI_REFUSE_FILETRANSFER       = 4
    INVALID_TYPE                  = 5
    NO_AUTHORITY                  = 6
    UNKNOWN_ERROR                 = 7
    BAD_DATA_FORMAT               = 8
    HEADER_NOT_ALLOWED            = 9
    SEPARATOR_NOT_ALLOWED         = 10
    HEADER_TOO_LONG               = 11
    UNKNOWN_DP_ERROR              = 12
    ACCESS_DENIED                 = 13
    DP_OUT_OF_MEMORY              = 14
    DISK_FULL                     = 15
    DP_TIMEOUT                    = 16
    OTHERS                        = 17  .
LOop at  lt_tab into wa_tab.
perform bdc_dynpro      using 'SAPL0F09' '0020'.
perform bdc_field       using 'BDC_CURSOR'
                               'V_T077S-TXT30(01)'.
perform bdc_field       using 'BDC_OKCODE'
                               '=NEWL'.
perform bdc_dynpro      using 'SAPL0F09' '0020'.
perform bdc_field       using 'BDC_CURSOR'
                               'V_T077S-BISNR(01)'.
perform bdc_field       using 'BDC_OKCODE'
                               '=SAVE'.
perform bdc_field       using 'V_T077S-KTOPL(01)'
                               WA_TAB-KTOPL."record-KTOPL_01_001.
perform bdc_field       using 'V_T077S-KTOKS(01)'
                               WA_TAB-KTOKS."record-KTOKS_01_002.
perform bdc_field       using 'V_T077S-TXT30(01)'
                               WA_TAB-TXT30."record-TXT30_01_003.
perform bdc_field       using 'V_T077S-VONNR(01)'
                               WA_TAB-VONNR."record-VONNR_01_004.
perform bdc_field       using 'V_T077S-BISNR(01)'
                               WA_TAB-BISNR."record-BISNR_01_005.
perform bdc_dynpro      using 'SAPLSTRD' '0300'.
perform bdc_field       using 'BDC_CURSOR'
                               'KO008-TRKORR'.
perform bdc_field       using 'BDC_OKCODE'
                               '=LOCK'.
perform bdc_field       using 'KO008-TRKORR'
                               WA_TAB-TRKORR."record-TRKORR_006.
perform bdc_dynpro      using 'SAPL0F09' '0020'.
perform bdc_field       using 'BDC_CURSOR'
                               'V_T077S-KTOPL(02)'.
perform bdc_field       using 'BDC_OKCODE'
                               '=BACK'.
perform bdc_dynpro      using 'SAPL0F09' '0020'.
perform bdc_field       using 'BDC_CURSOR'
                               'V_T077S-KTOPL(02)'.
perform bdc_field       using 'BDC_OKCODE'
                               '=BACK'.
perform bdc_transaction using 'OBD4'.
ENDLOOP.
FORM BDC_TRANSACTION USING TCODE.
   DATA: L_MSTRING(480).
   DATA: L_SUBRC LIKE SY-SUBRC.
* batch input session
* call transaction using
     REFRESH MESSTAB.
     CALL TRANSACTION 'OBD4' USING BDCDATA
                      MODE  'A'" CTUMODE
                      UPDATE 'S'"CUPDATE
                      MESSAGES INTO MESSTAB.
     L_SUBRC = SY-SUBRC.
       LOOP AT MESSTAB.
         SELECT SINGLE * FROM T100 WHERE SPRSL = MESSTAB-MSGSPRA
                                   AND   ARBGB = MESSTAB-MSGID
                                   AND   MSGNR = MESSTAB-MSGNR.
         IF SY-SUBRC = 0.
           L_MSTRING = T100-TEXT.
           IF L_MSTRING CS '&1'.
             REPLACE '&1' WITH MESSTAB-MSGV1 INTO L_MSTRING.
             REPLACE '&2' WITH MESSTAB-MSGV2 INTO L_MSTRING.
             REPLACE '&3' WITH MESSTAB-MSGV3 INTO L_MSTRING.
             REPLACE '&4' WITH MESSTAB-MSGV4 INTO L_MSTRING.
           ELSE.
             REPLACE '&' WITH MESSTAB-MSGV1 INTO L_MSTRING.
             REPLACE '&' WITH MESSTAB-MSGV2 INTO L_MSTRING.
             REPLACE '&' WITH MESSTAB-MSGV3 INTO L_MSTRING.
             REPLACE '&' WITH MESSTAB-MSGV4 INTO L_MSTRING.
           ENDIF.
           CONDENSE L_MSTRING.
           WRITE: / MESSTAB-MSGTYP, L_MSTRING(250).
         ELSE.
           WRITE: / MESSTAB.
         ENDIF.
       ENDLOOP.
   REFRESH BDCDATA.
ENDFORM.
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
   CLEAR BDCDATA.
   BDCDATA-PROGRAM  = PROGRAM.
   BDCDATA-DYNPRO   = DYNPRO.
   BDCDATA-DYNBEGIN = 'X'.
   APPEND BDCDATA.
ENDFORM.
FORM BDC_FIELD USING FNAM FVAL.
     CLEAR BDCDATA.
     BDCDATA-FNAM = FNAM.
     BDCDATA-FVAL = FVAL.
     APPEND BDCDATA.
ENDFORM.
But the FI consultant wants to add multiple records to 'G/L account group'.After adding records before saving the system need to ask transport request at the last.
How can I write code ...??
Please help me.

Hi Srikanth,
Thanks for reply,
You  are right we need to load hierarchy for G/L then we can see all the G/L's for all G/L groups.
I have one more question when I check in RSA3 for the G/L account numbers, I could not find them.
I am using the datasource fi_gl_4 and in rsa3 I can see 1000 records data and when I put filter on G/L account and search for the G/L number I needed I cant see it, but it is there in the functional transaction(f.01)?
How to check for the required G/L's in rsa3 ?
Thx

Similar Messages

  • HT1206 how do i add multiple phones to my itunes account?

    how do i add multiple phones to my account?

    Plug one in and sync it.
    Do the same for all of the others.

  • Can I add multiple Apple ID to my account for face time

    I'm trying to set up iPod touches that my 2 daughters received as Christmas presents. I would like to add multiple Apple ID to my apple account so they can use the face time features. How do I do this?

    They just need different email addresses. See:
    MacMost Now 653: Setting Up Multiple iOS Devices For Messages and FaceTime
    If you want:
    Create a NEW account/ID for them using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before. Make sure you specify a birthdate that results  being 13 year old or older
      Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
    Use the new ID on theniPod but only for:
    Settings>Messages>Send and Receive
    Settings>FaceTime
    Settings>GameCenter
    and Settings>iCloud if you want her to have separate Contacts Calendar and some other things.    
    Continue to use the same/common Apple ID for Settings>iTunes and App stores so you can share purchases.

  • Problem in creating Info record for vendor -AFFI account group

    Hi experts,
    I am trying to create a info record for a material for a vendor -1000 which is of AFFI account group.
    system in giving me an error saying that the material is not maintain in the plant 1000. However the plant i am working is for 2000 and the master data is maintained. I dont know why the system is giving a weird message taking the vendor code as the plant and giving the message " Material is not maintained in the plant"
    I have created an info record for this same material with another vendor code of the same AFFI account group. I think i am missing something in the master data of the vendor.
    Can anybody throw some lights on this.
    regards
    DP

    I got the solution. Thread closed.

  • Query is returning multiple records for a bank account id and party id

    Hi All,
    I am not getting why this query is returning multiple records for a particular bank account id and party id:
    SELECT instrument_payment_use_id
    ,instrument_type
    ,instrument_id
    ,start_date
    ,ext_pmt_party_id
    FROM iby_pmt_instr_uses_all
    WHERE instrument_id =:lv_num_ext_bank_account_id
    and exists (select 1 from iby_external_payees_all b where PAYEE_PARTY_ID= :lv_num_party_id and b.ext_payee_id = ext_pmt_party_id)
    I want above values to be used in api iby_disbursement_setup_pub.set_payee_instr_assignment in R12.
    Please help asap.
    Thanks

    O/P of query run for
    SELECT rowid, instrument_payment_use_id
    FROM iby_pmt_instr_uses_all
    WHERE instrument_id =6642
    AND EXISTS (
    SELECT 1
    FROM iby_external_payees_all b
    WHERE payee_party_id= 85470
    AND b.ext_payee_id = ext_pmt_party_id);
    is below:
    Rowid     INSTRUMENT_PAYMENT_USE_ID
    AABiDXAGIAABhiKAAS     236586
    AABiDXAGRAABSjtAAz     148437
    The version is R12

  • How do you add multiple users to an itunes account

    how do you add multiple users to an itunes account

    First :
    Using an iPhone without a wireless service plan
    Then restore the iPod to factory settings/new iPod on the computer your kids will use:
    iTunes: Restoring iOS software
    If you are using the same computer
    How to use multiple iPods, iPads, or iPhones with one computer

  • How do I add multiple information under an user account?

    David, Thanks for all your help and I'm almost finished.  Hopefully this will be the last item.  I have users that register and then go to a profile page.  I need them to be able to recieve multiple messages and also input multiple scores.  I figured out how to do this but with only them being able to add one of each (its stored in the database table).  How can store multiple items for each user (with users continuing to increase)?  It's almost like I need a table for each individual user...

    Thanks, but I will proceed.  So getting back to my question...I figured that I needed a new table which I have.  I also set up a user page based on the session MM_Username and that is working fine.  I have 8 users in and everything is working fine on that end...that isn't the problem.  I used the insert command to insert all data/foreign key into table2 that I needed.  I need to be able to display a set of records from (table2) and when I try to use the MM_Username to filter that table, it doesn't work.  My understanding was that when a user is logged in, the session for each page is MM_Username so if the tables are set up with the same information, why doesn't it work?  I also inserted the table in the main loggin page and it actually does pull up the information, but even though I have the "repeat region command" it only shows the first record...it does however pull the first record for the logged in user.  But doesn't work at all on another page.  Please help.

  • How to loop and add multiple records from db in .pdf using cfdocument

    I have a query that pulls a users information (Id, FirstName,
    LastName, Title,etc). I then use cfdocument to output a person's
    biography into a pdf. This is great, because we no longer have to
    manually create bios, as they are now all dynamically generated.
    The problem I have now is that we want to be able to select
    multiple users and create a .pdf with each of their bios included
    in the one pdf.
    How do I loop thru records from a sql database in a
    cfdocument that includes a header and footer in cfdocument items,
    and ensure that one persons bio doesn't continue on the page with
    anothers.
    Here's the code I have so far for the cfdocument:

    Put the query around just the body of your cfdocument not
    around the whole cfdocument tag. Also, move any query information
    out of the header and put that in the body of the document. Lastly,
    put a cfdocumentitem pagebreak after each bio...you will need to
    check the recordcount of the query against the row you are on so
    that you don't add an empty page break at the end.

  • How to add multiple records in table thru form via Submit button

    Hi all
    i have small requirement as follows.
    i have a view in which i have 3 UI elements one is webdynpro form,Table UI element and third one is submit button.
    now at runtime when i will enter the details in the form and click on the submit button then those record details has been stored in Table. then next time again when i submit the form with details then the table contains all records of current and existing ...so table has to maintain mutile records thru form via submit form..
    i need sample code on the same.
    points are always rewardable
    Thanks
    Sunil

    Hi,
    Create one context attribute and map it to the Inputfiled and one submit button, create a node with a valueattribute map it to a Table and in onActionsubmit write this code
    public void onActionsubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionsubmit(ServerEvent)
        String str=wdContext.currentContextElement().getInputfiledattribute();
        IPrivateTableformView.ITablenodeNode node=wdContext.nodeTablenode();
       IPrivateTableformView.ITablenodeElement ele=node.createTablenodeElement();
       ele.setNodeattribute(str);
       node.addElement(ele);
        //@@end
    thanx,
    ramani.p

  • Add multiple records thorough lov, help of one field?

    Hi All:
    Actually, I have a datablock with two fields, one is id, other one is name. I select no of records in datablock is 3.My requirement is, there is should be one field on the above of this block.on this block should be lov. suppose that field name is "abc_name", lov delivers value in abc_name and there should be button. when button pressed then value transfer from abc_name to datablock field "name".
    when i enter the 2nd value then on pressing button it will transfer on other record of datablock field "name" and so on. Please help me. How it will be done. I am unable to transfer more than one records from "abc_name". to datablock fied "name".Thanks
    Ali

    I'm sorry, it's not clear to me what you want.
    Are you saying that when you select a value from the LOV it should populate ALL the records rather than just the current one?

  • Need to add multiple company codes to user accounts.

    I am new to SRM 5.0. I have been asked to add all Non-US company codes for two users. Do I have to add it through PPOMA_BBP - under attributes-- select company code and add it there. If so, I have at least 35 Non-US company codes to add. I cannot select them all. Do I have to add them one by one. Or is there any other process? Please advise if I am doing it correctly.

    Hi
    If it is specific to the two users then you need to assign one by one this is the only why.  But if it for then you can maitain that root leve.
    regards
    satish

  • How do I add multiple text block records from text file?

    The data manager documentation (page 151) for MDM 5.5 SP3 indicates that one or more new text blocks can be added to the Text Blocks object table from files. It is noted that the files must be plain text files.
    I use notepad and create a text file with two lines as follows:
    Test 1
    Test 2
    When I try to add the text blocks following documentation mentioned above, it only adds one record for the Data Group I have chosen and the record contains the entry "Test 1" from the first line in the text file.
    How can I add multiple records to the data group from a file?

    From my testing it appears that you need to have one text file per text block record in Data Manager.
    I wrote VBA macro to so that I could input my text blocks into an Excel spreadsheet and then the macro will take the contents of each cell in a highlighted column and create one text file per cell.
    Then using Data manager, I can select all of the text files at once and it will import them, creating one record per text file.

  • How to add payment advice for XML file filed in vendor account group

    Hi All,
    I have a requirment to add Payment advice for XML file field in vendor account group under payment transcation tap,
    kindly advice where i can add above mention field in vendor account group.
    thanks
    khaja

    done

  • Why are there multiple keychain records for same email account?

    I have noticed that it takes sometimes up to 45 seconds for Apple Mail to send (whoosh...) an email. Then I started getting an alert asking for my password intermittently.
    I checked my KeyChain Access and note 5 records for this email account dating back to 2007 and while the password hasn't changed in all these years, I note the "Where" field is different in some of these records. So my uneducated hunch is Apple Mail is getting a little confused and having to go thru all 5 records insteads of just one.
    As note multiple records for other email accounts and website logins I have.
    1. Why is this happening?
    2. Is it normal
    3. Can I, should I, delete all but one for each item be it an email account or web login, etc.
    or
    Should I delete all 5 and let a brand new one be created for Keychain next time I send or get email for this particular email account?
    I also see there is some info on keychain syncing. Does this have anything to do with my situation?
    Thx,
    Steven

    I'm a little distracted with Steve's passing. He will be missed to say the least
    But if it isn't too disrepectful to reply at this time, I'm unclear with your advise because there are 5 items all for the same email account. A couple are duplications, and the others have slightly different "Where" info.
    I can't imagine I need all 5 and wonder if I should delete 4 and keep the newest one?
    All my email accounts have multiple entries.
    Anyone know why this is happening and if it's OK to delete the oldest ones and keep just the newest?

  • Add multiple users to AD Group using AddRange

    All,
    I am trying to add multiple users to an AD security group using AddRange method but no luck.
    Reason why I am using AddRange method is, the memberlist is pretty big (30K users) and Quest or MSFT AD Cmdlets taking plenty of time to add them.
    I am following the instruction per http://msdn.microsoft.com/en-in/library/ms180904(v=vs.80).aspx but no luck.
    Code snippet:
    $groupmembers = Get-Content C:\Temp\MemberDN.txt
    $getgroup = [ADSI]"LDAP://CN=MYADGROUP,OU=GROUPS,DC=CONTOSO,DC=COM"
    $getgroup.properties.member.AddRange($groupmembers)
    #$getgroup.properties["member"].AddRange($groupmembers)
    $getgroup.CommitChanges()
    #$getgroup.SetInfo()
    I tried using ADSPATH as well but no luck.
    Any help or pointers are appreciated.
    Thanks.

    Hi PSPR,
    I agree with David .
    Also I tested that on my server2012r2 , please refer to :
    $user="cn=test1,cn=users,dc=test,dc=com","cn=test2,cn=users,dc=test,dc=com"
    $obj=[adsi]"LDAP://cn=test,cn=users,dc=test,dc=com"
    $obj.member.addrange($user)
    $obj.commitchanges()
    Hope it helps
    Best Regards
    Elton Ji
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

Maybe you are looking for

  • Logical Standby - LGWR or ARCH mode

    After reading the [Setting the Data Protection Mode of a Data Guard Configuration|http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/log_transport.htm#i1183694] , I'm still confusing about it! What is the main difference between LGWR or A

  • VAT calculation going wrong in dealer invoice

    Hi All, I am doing a dealer purchase scenario where in am giving basic price inclusive of excise in the PO and then while capturing excise invoice am changing the base value and excise duties manually in MIGO by checking MRP indicator such that sum o

  • JSF requires Struts?

    Hi, I see a lot of examples of JSP and Struts and seems that one requires the other, it is true? Its is true I need Struts for use JSF? Thanks, Lorenzo

  • Photoshop cs4 trial

    I have downloaded the trial like 4 different times and when click on the installer it tells me installer database may be corrupt.....Help plz someone..

  • My itunes program will open in windows 7, but as soon as I choose a tune, it automatically closes

    I have installed Windows 7. My itunes program appears as normal when I open it.  When I click on any song or book to play, it automatically closes down.  I have tried reinstalling itunes with no success. I am also running Norton 360.  If this continu