Not entering into the loop

Hi Friends,
I have written a BDC program to upload salesorder data. But it is not entering into
<b>LOOP AT ITAB and ENDLOOP.</b>
Can anyone correct the following code.
REPORT  SAMPLE NO STANDARD PAGE HEADING.
  TABLES ***********************************************
TABLES : VBAK, "Sales doc header data
         VBAP, "Sales doc item data
         VBKD. "Sales doc business data
INTERNAL TABLE DECLERATION ************************
data : begin of itab occurs 0,
           VBELN LIKE VBAK-VBELN,   "Sales docu no
           AUART LIKE VBAK-AUART,   "sales doc type
           VKORG LIKE VBAK-VKORG,   "sales organization
           VTWEG LIKE VBAK-VTWEG,   "dist channel
           SPART LIKE VBAK-SPART,   "division
           VKGRP LIKE VBAK-VKGRP,   "sales group
           VKBUR LIKE VBAK-VKBUR,   "sales office
           KUNNR LIKE VBAK-KUNNR,   "customer no
           AUDAT LIKE VBAK-AUDAT,   "document date
           WAERK LIKE VBAK-WAERK,   "SD doc currency
           POSNR LIKE VBAP-POSNR,   "Sales doc item no
           PSTYV LIKE VBAP-PSTYV,   "Sales doc item category
           WERKS LIKE VBAP-WERKS,   "Plant
           MATNR LIKE VBAP-MATNR,   "Material No
           BSTKD LIKE VBKD-BSTKD,   "Customer po number
           BSTDK LIKE VBKD-BSTDK,   "Customer PO date
           PRSDT LIKE VBKD-PRSDT,   "Date for pricing and exchange rate
           ZTERM LIKE VBKD-ZTERM,   "Terms of payment key
           INCO1 LIKE VBKD-INCO1,   "incoterms (part1)
           INCO2 LIKE VBKD-INCO2,   "incoterms (part2)
       end of itab.
data : i_bdcdata like bdcdata occurs 0 with header line.
data : v_date(8).
parameters : p_file like rlgrap-filename default 'C:\TEXT.TXT'.
START OF SELECTION **********************************
START-OF-SELECTION.
CALL FUNCTION 'UPLOAD'
EXPORTING
  CODEPAGE                      = ' '
   FILENAME                      = p_file
   FILETYPE                      = 'DAT'
  ITEM                          = ' '
  FILEMASK_MASK                 = ' '
  FILEMASK_TEXT                 = ' '
  FILETYPE_NO_CHANGE            = ' '
  FILEMASK_ALL                  = ' '
  FILETYPE_NO_SHOW              = ' '
  LINE_EXIT                     = ' '
  USER_FORM                     = ' '
  USER_PROG                     = ' '
  SILENT                        = 'S'
IMPORTING
  FILESIZE                      =
  CANCEL                        =
  ACT_FILENAME                  =
  ACT_FILETYPE                  =
  TABLES
    DATA_TAB                      = itab.
EXCEPTIONS
  CONVERSION_ERROR              = 1
  INVALID_TABLE_WIDTH           = 2
  INVALID_TYPE                  = 3
  NO_BATCH                      = 4
  UNKNOWN_ERROR                 = 5
  GUI_REFUSE_FILETRANSFER       = 6
  OTHERS                        = 7
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at itab.
  concatenate itab-bstdk4(2) itab-bstdk6(2) itab-bstdk(4) into v_date.
  refresh i_bdcdata.
  move v_date to itab-bstdk.
  perform mybdcdata.
CALL TRANSACTION 'VA01' using i_bdcdata MODE 'A' .
endloop.
*&      Form  mybdcdata
      text
form mybdcdata.
  perform mydata using : 'X' 'SAPMV45A' '0101',
                         '' 'VBAK-AUART' itab-auart,
                         '' 'VBAK-VKORG' itab-vkorg,
                         '' 'VBAK-VTWEG' itab-vtweg,
                         '' 'VBAK-SPART' itab-spart,
                         '' 'VBAK-VKBUR' itab-vkbur,
                         '' 'VBAK-VKGRP' itab-vkgrp,
                         '' 'BDC_OKCODE' '/00',
                         'X' 'SAPMV45A' '4001',
                         '' 'VBKD-BSTKD' itab-bstkd,
                         '' 'VBKD-BSTDK' itab-bstdk,
                         '' 'KUAGV-KUNNR' itab-kunnr,
                         '' 'BDC_OKCODE' 'T\02',
                         'X' 'SAPMV45A' '4001',
                         '' 'VBAP-POSNR' itab-posnr,
                         '' 'VBAP-PSTYV' itab-pstyv,
                         '' 'VBAP-MATNR' itab-matnr,
                         '' 'BDC_OKCODE' 'T\04',
                         'X' 'SAPMV45A' '4002',
                         '' 'VBKD-ZTERM' itab-zterm,
                         '' 'VBKD-INCO1' itab-inco1,
                         '' 'VBKD-INCO2' itab-inco2,
                         '' 'BDC_OKCODE' 'T\02',
                         'X' 'SAPMV45A' '4002',
                         '' 'VBAK-AUDAT' itab-audat,
                         '' 'VBAK-WAERK' itab-waerk,
                         '' 'VBKD-PRSDT' itab-prsdt.
                        '' 'BDC_OKCODE' 'T\07'.
endform.                    "mybdcdata
*&      Form  mydata
      text
     -->A1         text
     -->A2         text
     -->A3         text
form mydata using a1 a2 a3.
  if a1 = 'X'.
    clear i_bdcdata.
    i_bdcdata-dynbegin = a1.
    i_bdcdata-program  = a2.
    i_bdcdata-dynpro   = a3.
    append i_bdcdata.
  else.
    clear i_bdcdata.
    i_bdcdata-fnam = a2.
    i_bdcdata-fval = a3.
    append i_bdcdata.
  endif.
endform.                    "mydata
waiting for ur reply...
Thanks
Raj

Hi Rajkumar,
Try this code i have changed in between.
just cheking itab wether itab  contains records or not.
if itab has no records check ur flat file.
REPORT SAMPLE NO STANDARD PAGE HEADING.
TABLES ***********************************************
TABLES : VBAK, "Sales doc header data
VBAP, "Sales doc item data
VBKD. "Sales doc business data
INTERNAL TABLE DECLERATION ************************
data : begin of itab occurs 0,
VBELN LIKE VBAK-VBELN, "Sales docu no
AUART LIKE VBAK-AUART, "sales doc type
VKORG LIKE VBAK-VKORG, "sales organization
VTWEG LIKE VBAK-VTWEG, "dist channel
SPART LIKE VBAK-SPART, "division
VKGRP LIKE VBAK-VKGRP, "sales group
VKBUR LIKE VBAK-VKBUR, "sales office
KUNNR LIKE VBAK-KUNNR, "customer no
AUDAT LIKE VBAK-AUDAT, "document date
WAERK LIKE VBAK-WAERK, "SD doc currency
POSNR LIKE VBAP-POSNR, "Sales doc item no
PSTYV LIKE VBAP-PSTYV, "Sales doc item category
WERKS LIKE VBAP-WERKS, "Plant
MATNR LIKE VBAP-MATNR, "Material No
BSTKD LIKE VBKD-BSTKD, "Customer po number
BSTDK LIKE VBKD-BSTDK, "Customer PO date
PRSDT LIKE VBKD-PRSDT, "Date for pricing and exchange rate
ZTERM LIKE VBKD-ZTERM, "Terms of payment key
INCO1 LIKE VBKD-INCO1, "incoterms (part1)
INCO2 LIKE VBKD-INCO2, "incoterms (part2)
end of itab.
data : i_bdcdata like bdcdata occurs 0 with header line.
data : v_date(8).
parameters : p_file like rlgrap-filename default 'C:\TEXT.TXT'.
START OF SELECTION **********************************
START-OF-SELECTION.
<b>perform upload_data.
if not itab[ ] is initial .
perform  bdc_populate.</b>
<b>else.
write :/  ' no records in itab '.
endif.</b>
<b>form upload_data.</b>
CALL FUNCTION 'UPLOAD'
EXPORTING
CODEPAGE = ' '
FILENAME = p_file
FILETYPE = 'DAT'
ITEM = ' '
FILEMASK_MASK = ' '
FILEMASK_TEXT = ' '
FILETYPE_NO_CHANGE = ' '
FILEMASK_ALL = ' '
FILETYPE_NO_SHOW = ' '
LINE_EXIT = ' '
USER_FORM = ' '
USER_PROG = ' '
SILENT = 'S'
IMPORTING
FILESIZE =
CANCEL =
ACT_FILENAME =
ACT_FILETYPE =
TABLES
DATA_TAB = itab.
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
<b>endform.</b>
form bdc_populate.
loop at itab.
concatenate itab-bstdk4(2) itab-bstdk6(2) itab-bstdk(4) into v_date.
refresh i_bdcdata.
move v_date to itab-bstdk.
perform mybdcdata.
CALL TRANSACTION 'VA01' using i_bdcdata MODE 'A' .
endloop.
<b>endform.</b>
*& Form mybdcdata
text
form mybdcdata.
perform mydata using : 'X' 'SAPMV45A' '0101',
'' 'VBAK-AUART' itab-auart,
'' 'VBAK-VKORG' itab-vkorg,
'' 'VBAK-VTWEG' itab-vtweg,
'' 'VBAK-SPART' itab-spart,
'' 'VBAK-VKBUR' itab-vkbur,
'' 'VBAK-VKGRP' itab-vkgrp,
'' 'BDC_OKCODE' '/00',
'X' 'SAPMV45A' '4001',
'' 'VBKD-BSTKD' itab-bstkd,
'' 'VBKD-BSTDK' itab-bstdk,
'' 'KUAGV-KUNNR' itab-kunnr,
'' 'BDC_OKCODE' 'T\02',
'X' 'SAPMV45A' '4001',
'' 'VBAP-POSNR' itab-posnr,
'' 'VBAP-PSTYV' itab-pstyv,
'' 'VBAP-MATNR' itab-matnr,
'' 'BDC_OKCODE' 'T\04',
'X' 'SAPMV45A' '4002',
'' 'VBKD-ZTERM' itab-zterm,
'' 'VBKD-INCO1' itab-inco1,
'' 'VBKD-INCO2' itab-inco2,
'' 'BDC_OKCODE' 'T\02',
'X' 'SAPMV45A' '4002',
'' 'VBAK-AUDAT' itab-audat,
'' 'VBAK-WAERK' itab-waerk,
'' 'VBKD-PRSDT' itab-prsdt.
'' 'BDC_OKCODE' 'T\07'.
endform. "mybdcdata
*& Form mydata
text
-->A1 text
-->A2 text
-->A3 text
form mydata using a1 a2 a3.
if a1 = 'X'.
clear i_bdcdata.
i_bdcdata-dynbegin = a1.
i_bdcdata-program = a2.
i_bdcdata-dynpro = a3.
append i_bdcdata.
else.
clear i_bdcdata.
i_bdcdata-fnam = a2.
i_bdcdata-fval = a3.
append i_bdcdata.
endif.
endform. "mydata
Regards.
Francis.

Similar Messages

  • Appointments on the BB Pearl are not entered into the Outlook 2007 Calendar

    The issue that I am having is as follows:
    Calendar entries created on the BlackBerry Pearl are not being entered into the Outlook 2007 calendar. 
    Entries created in the Outlook 2007 calendar are being correctly entered into the BlackBerry Pearl calendar.
    I have made several attempts to fix the issue including:
    Removing and reinstalling the most recent version of the BB Desktop Software.
    Deleting all email accounts but 1, removing and re-sending the service books.
    Resetting the BlackBerry Pearl back to factory default.
    Any suggestions would be appreciated at this point.

    Hi and welcome to the forums!
    You may have a corrupt Device calendar. Use the following procedure to correct:
    http://www.blackberry.com/btsc/search.do?cmd=displayKC&docType=kc&externalId=KB04950&sliceId=SAL_Pub...
    If you need more info please ask!  If not please resolve the thread using the options by the Kudos’ star, Just place the check in the Post that answered your question, Thanks  
    Click Accept as Solution for posts that have solved your issue(s)!
    Be sure to click Like! for those who have helped you.
    Install BlackBerry Protect it's a free application designed to help find your lost BlackBerry smartphone, and keep the information on it secure.

  • Css style in css panel but it is not entering into the actual css linked file

    I have entered a couple of class styles in my css panel but when I go to view the actual linked css file those styles are not there. Of course, previewing and viewing on the server do not show the styles. I know I can manually enter them in the file but that kind of defeats the purpose of the panel. Any ideas?  Thanks.

    Did you save the CSS file after making changes to it?
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    http://alt-web.com/
    http://twitter.com/altweb

  • I can not enter into the app store

    HI
    I can not Login the app store from my iPhone Because of my address.
    I tried to change my address to my original Country
    but their is this massage "you have a store credit balance; you must spend your balance before you can change store".
    so i bought two applications for my mac to spend my balance but still their is .43 $ which is i can't spend it to settle my balance.
    now I Transferor my .43 $ to change my address to my original address so i can Login the app store and update all apps also purchases another app as well as I was able to.
    Sincerely
    ALI JAAFAR

    You shouls be seeing this (tap to enlarge image)

  • SCCM 2012: F8 debug widow not working (At-least not visible) after entering into the "Currently installed Windows 7 Image": F8 works in winPE

    F8 debug widow not working (At-least not visible) after entering into the "Currently installed Windows 7 Image"
    F8 option turned on in the boot image.
    F8 debug window works in Windows PE.
    F8 debug window does not show-up on F8 key-press after entering the 'Currently installed Windows 7 Image" all the way to the end of the task sequence.
    But after a 'Restart Step' (and if F8 was pressed) the Task Sequence tends to pause indefinitely as if the
    F8 debug screen is open in the background.
    I am using SCCM 2012 SP1 (CU 1 is
    not an option at the moment).
    Any ideas as to how I could get the debug F8 option back?

    There have been a couple reported occurrences of this (or something similar) to my knowledge with no resolution in the forums. Your best bet may be to open a case with CSS.
    Also note that if you were going to do a CU, why would you pick CU1 instead of CU4? And, can I ask why it's not an option out of curiosity?
    Jason | http://blog.configmgrftw.com

  • Why do my 3rd party loops not appear in the "Loop" tab?

    I have saved some Magix wav loops into the local apple users directory of Logic Express and though I can find them using the media browser they do not appear in the loops tab listing.
    Does anybody know the cure for this?

    If you drag your .wav loops into the arrange area do they function properly?  If not, you may need to convert them using Apple Loops Utility.  After doing that you can drag the folder with the .aiff conversions onto your loops tab to import them.
    You might find this old thread useful:
    http://www.logicprohelp.com/forum/viewtopic.php?f=1&t=37200

  • Record not inserting into the table through Forms 10g

    Hi all,
    I have created a form in 10g(10.1.2.0.2) based on just one table that has 4 columns(col1, col2, col3, col4).
    Here col1, col2 and col3 are VARCHAR2 and col4 is date and all the columns are not null columns(There are no primary and foriegn key constrains, which means duplicates are allowed).
    My form contains 2 blocks where block 1 has one text item (col1) and 3 buttons (Delete, Save, Exit).
    And block2 is a database block and has col2,col3,col4 which are in tabluar layout frame displaying 10 records.
    When the form is opened the cursor has to be in block1.col1 for querrying. Here i enter a value in col1, and then when I click on col2 in the block2, then I put execute_query in new_block_instance of block2, which displays the records.
    The block2 properties are not updatable, insertable and query is allowed.
    Everything is working good until here. But here in the block2 when I want to insert another record into the table, by navigating all the way down to the last empty record and entering the new values for col2, col3 and col4 And then Ctrl+S will display the message "*FRM-40400: Transaction complete: 1 record applied and saved.*" But actually the record is not inserted into the table.
    I also disabled the col4 by setting the Enabled property to No, since while inserting new record the date have to be populated into it and it shouldnt be changed by the user. And im populating the sysdate into the new record by setting Intial Value property to *$$DATE$$*.
    And another requirement which I could not work arround here is that, the col3 also should be populated with the username of the user while inserting.
    please help me...

    Hi Sarah,
    I do not want to update the existing record. So I kept Udate Allowed to No in property palette for the items in block2.
    Do I have to do this property at block level also?
    I'm inserting a new record here.
    Edited by: Charan on Sep 19, 2011 8:48 AM

  • Proceedure to get the Birthdays and Anniversar​ies entered into the Contacts

    I am using blackberry Z10, OS version 10.3.12243. Please inform the proceedure to get the Birthdays and Anniversaries entered into the Contacts, automatically updated in the Calander.
    This updation is now limited to my facebook friends. 
    Subject Title edited to reflect new topic.

    @purnrndu You probably should have started your own thread.
    Are you saying you have birthdays entered for contacts and those do not appear in Calendar? If that is the problem, I'm not seeing this problem.
    There are numerous issues with the 10.3.1 on the different BB10 models. It is hard to know if this is one of them or not. Are you not having the other issues that users are finding?
    As far as a resolution, you might do a backup, then a security wipe, then restore. See if that fixes it.
    Another alternative is to do a clean OS install using an autoloader. This is being recommended by other users to resolve the problems users are finding with the upgrade when done OTA or via Link. If you choose this route, don't forget to do a backup first.
    - Ira

  • I can not login into the system.

    Hello! A problem - I can not login into the system. After entering the login and password for a second or two there is a blue screen, then the universe, then again a blue screen, and - again, the login window. This happens with just one account of the four on my iMac-2007 with OS 10.6.8. How can I be?

    Click here and follow the instructions.
    (36381)

  • Onetime vendor - address is not copied into the purchase order ME21N

    Dear all,
    I have a issue about using onetime vendors, if I have entered a dummy address on the onetime vendor, this address is not copied into the prucase order when I create a PO for this vendor type.
    My problem is that we want to use the ME59 to create PO automatically for these onetime vendors but I get the message 06035 - Enter a address on the PO.
    So my question is if anybody can propose a solution for this.
    Best regards, LB

    >
    Lars Birk wrote:
    > Dear all,
    >
    > I have a issue about using onetime vendors, if I have entered a dummy address on the onetime vendor, this address is not copied into the prucase order when I create a PO for this vendor type.
    > My problem is that we want to use the ME59 to create PO automatically for these onetime vendors but I get the message 06035 - Enter a address on the PO.
    > So my question is if anybody can propose a solution for this.
    >
    >
    > Best regards, LB
    One time vendor can never hold vendor specific details i.e. vendor details and bank details. You cannot use a one time vendor for ME59, use regular vendor account instead for your requirement or enter the address manually at time of conversion as per the message.
    Edited by: Afshad Irani on Jul 13, 2010 1:34 PM

  • VERY URGENT, I CAN NOT ENTER IN THE PORTAL

    Hi,
    yesterday i changed the number of sessions in the visual administrator, Visual Administrator->services->Security Provider ->properties -> sessions_size,  from 200 to 1 and now we can not enter in the portal even from visual administrator.
    any idea please??

    Hi did you tried implementing the solution given in
    Unable to login to Visual Admin
    Also go to this path and check
    if No body can log into the portal until this account is disabled and a new super admin is created.                                             
    Information about portal setup and configuration can be found on
    help.sap.com --> Netweaver --> EP6 =< NW04                                             
    Specifically look into the Administration Guide --> User Admin section on how to create a super admin user and disable sap*.                                             
    I am trying my level best to help you, also please open an OSS message with SAP in the meantime.

  • My deleted files do not go into the Trash Folder

    Deleted emails do not go into the Trash Folder even though my configurations are correct and I have selected Trash Folder for my deleted files. Is something wrong with TB? This just started happening recently.
    Also the auto-fill is not working correctly. When I start to type an email addr in Compose, non-related email addrs appear. I know that TB uses the 'within' range as opposed to 'starts with' but that still does not explain my problem. If I enter 'h' into the To: field, email addresses that do not contain the letter h anywhere (first name, last name, email addr, etc.) appear.
    Please help.

    Start by looking here Solving Trash Problems - The X Lab
    If you still have the problem after that post back.
    regards

  • After the last update of the iPhone 5.1 sound became low tones specifically entered into the settings and made the maximum sound d, but to no avail there is no update for this problem Haddl Is it possible to delete the Japanese language and take advantage

    After the last update of the iPhone 5.1 sound became low tones specifically entered into the settings and made the maximum sound d, but to no avail there is no update for this problem Haddl Is it possible to delete the Japanese language and take advantage of memory storage space
    Osmhto tried to solve the problem of low sound we have become we do not hear a tone sounds clearly like the first phone

    hello...
    I am having the same issue here... just upgraded my 5s to 7.1.1 (never jailbroken - factory unlocked) and then boom... NO Service!!! Searching ... that's it. currently using Smart Telecom Sim... at first it was working for me... after 6-7 hours, it started the No Service issue. I cannot send a text or make a call...
    I did the steps you have taken but it is still not working... any updates on your end?

  • HT204266 I can not log into the App Store, even though I am logged in to iTunes. ? Help please :)

    I can not log into the App Store, even though I am logged in to App Store and my password is entered into the settings. This appended after I accidentally switched to the British version of iTunes and I logged out and back in to get to the US. Now, I keep getting an error message that I can not log into the App Store. I have tried updating it to the computer and restarting, but still keep getting the error message. Help please! :)

    I am afraid all apps are tied to the Apple ID they are purchased with and are not transferable.
    Your son have to buy those apps with his own Apple ID and start from scratch.

  • Unable to enter into the sql prompt

    hi...
    I am upgrading the version 11.1.0.7 tp 11.2.0.1. I am using linux red hat os version 5. After installing components i was unable to enter into the sql promt . the error message is like this.
    sp2-1503: unable to initialize oracle call interface
    sp2-0152: ORACLE may not be functioning properlyEdited by: 845224 on Mar 28, 2011 3:12 AM

    i have mentioned wrong path before... now i have cleared al those and now i am try to start DBUA . It is telling that database is not mounted.
    Then i manually tried to start up mount . It is showing the error message like this
    ORA-01078: failure in process in system parameters
    LRM-00109: could not open parameter filethen if i try to create pfile from spfile it telling the following error.
    ORA-01078: failure in process in system parameters
    LRM-00109: could not open parameter file

Maybe you are looking for