Need simple ABAP OO reports, BAPI's and BDC upload using flat file.
Hello experts,
I am currently practicing ABAP and I would like to request some example codes for ABAP Objects, BAPIs, BDC's, etc.
Thanks!
hi viray,
check these...
BAPI'S..
http://help.sap.com/saphelp_47x200/helpdata/en/e0/9eb2370f9cbe68e10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_47x200/helpdata/en/3e/ecf226942511d2ad4b080009b0fb56/frameset.htm
http://www.sapgenie.com/abap/bapi/index.htm
Abap Objects
http://www.sapgenie.com/abap/OO/index.htm
http://sap.ittoolbox.com/documents/industry-articles/introducing-abap-objects-982
http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/content.htm
bdc's...
http://www.sappoint.com/abap/bdcconcept.pdf
http://wiki.ittoolbox.com/index.php/Topic:ABAP_-_BDC
http://www.sap-img.com/bdc.htm
hope these help,
do reward if it helps,
priya.
Message was edited by: Priya
Similar Messages
-
I need to know thelist of bapi's and function modules used for transaction
I need to know thelist of bapi's and function modules used for transaction in order to use these FM or BAPI in reading some fields of equipment master and functional loocation.Can any one suggest me some methods...or do i need to write a report for the same.
Steps to find the BAPI/function modules used in a transaction
1) Find the package of the transaction thro' SE93.
For example the package for the transaction VA03 is VA
2) Go to Se80, key-in the package (say VA)
3) You can see the function modules under the folder finction group and
you can see the BAPI's under the folder Business Engineering-> Business Objects-> double click on the released methods of the Business Objects -
How to create the Export Data and Import Data using flat file interface
Hi,
Request to let me know based on the requirement below on how to export and import data using flat file interface.....
Please provide the steps involved for the same.......
BW/BI - Recovery Process for SNP data.
For each SNP InfoProvider,
create:
1) Export Data:
1.a) Create an export data source, InfoPackage, comm structure, etc. necessary to create an ASCII fixed length flat file on the XI
ctnhsappdata\iface\SCPI063\Out folder for each SNP InfoProvider.
1.b) All fields in each InfoProvider should be exported and included in the flat file.
1.c) A process chain should be created for each InfoProvider with a start event.
1.d) If the file exists on the target drive it should be overwritten.
1.e) The exported data file name should include the InfoProvider technical name.
1.f) Include APO Planning Version, Date of Planning Run, APO Location, Calendar Year/Month, Material and BW Plant as selection criteria.
2) Import Data:
2.a) Create a flat file source system InfoPackage, comm structure, etc. necessary to import ASCII fixed length flat files from the XI
ctnhsappdata\iface\SCPI063\Out folder for each SNP InfoProvider.
2.b) All fields for each InfoProvider should be mapped and imported from the flat file.
2.c) A process chain should be created for each InfoProvider with a start event.
2.d) The file should be archived in the
ctnhsappdata\iface\SCPI063\Archive directory. Each file name should have the date appended in YYYYMMDD format. Each file should be deleted from the \Out directory after it is archived.
Thanks in advance.
TysonHere's some info on working with plists:
http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/Introduc tion/chapter1_section1.html
They can be edited with any text editor. Xcode provides a graphical editor for them - make sure to use the .plist extension so Xcode will recognize it. -
To know thelist of bapi's and function modules used for transaction IH10
I need to know thelist of bapi's and function modules used for transaction in order to use these FM or BAPI in reading some fields of equipment master and functional loocation.Can any one suggest me some methods...or do i need to write a report for the same.
hi,
provide report name (here: RIEQUI20)
goto se38 - utilities - cross reference - function modules
or use report RPR_ABAP_SOURCE_SCAN
with search string call function
A.
Message was edited by:
Andreas Mann -
hi friends,
Iam new to Bapi's and Bdc's plz tell me which sites are good for learning and i also want some realtime examples or codes.
Thanks in advance.Hi
what is BAPI?
BAPI stands for Business API(Application Program Interface).
A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
You can make your function module remotely enabled in attributes of Function module but
A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).
BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
The following standardized BAPIs are provided:
Reading instances of SAP business objects
GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.
The BAPI GetList() is a class method.
GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type
The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
Create( ) and CreateFromData! ( )
The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
Change( )
The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
BAPI-step by step
http://www.sapgenie.com/abap/bapi/example.htm
list of all bapis
http://www.planetsap.com/LIST_ALL_BAPIs.htm
for BAPI's
http://www.sappoint.com/abap/bapiintro.pdf
http://www.sappoint.com/abap/bapiprg.pdf
http://www.sappoint.com/abap/bapiactx.pdf
http://www.sappoint.com/abap/bapilst.pdf
http://www.sappoint.com/abap/bapiexer.pdf
http://service.sap.com/ale
http://service.sap.com/bapi
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
http://www.planetsap.com/Bapi_main_page.htm
http://www.topxml.com/sap/sap_idoc_xml.asp
http://www.sapdevelopment.co.uk/
http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
Also refer to the following links..
www.sappoint.com/abap/bapiintro.pdf
www.sap-img.com/bapi.htm
www.sap-img.com/abap/bapi-conventions.htm
www.planetsap.com/Bapi_main_page.htm
www.sapgenie.com/abap/bapi/index.htm
Checkout !!
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
http://techrepublic.com.com/5100-6329-1051160.html#
http://www.sap-img.com/bapi.htm
http://www.sap-img.com/abap/bapi-conventions.htm
http://www.sappoint.com/abap/bapiintro.pdf
u can check the below the material also
Example Code
U need to give the step_nr, item_nr, cond_count and cond_type so the correct conditon will be updated. If no condition exists for the given parameters, a new condition will be created.
U can find these parameters for a particular condition type in table KONV.
*& Form saveTransactionJOCR
text
--> p1 text
<-- p2 text
FORM saveTransactionJOCR .
data: salesdocument like BAPIVBELN-VBELN,
order_header_inx like bapisdh1x,
order_header_in like bapisdh1,
return type standard table of bapiret2 with header line,
conditions_in type standard table of bapicond with header line,
conditions_inx type standard table of bapicondx with header line,
logic_switch like BAPISDLS,
step_nr like conditions_in-cond_st_no,
item_nr like conditions_in-itm_number,
cond_count like conditions_in-cond_count,
cond_type like conditions_in-cond_type.
salesdocument = wa_order_information-VBELN.
LOGIC_SWITCH-COND_HANDL = 'X'.
order_header_inx-updateflag = 'U'.
conditions
clear conditions_in[].
clear conditions_inx[].
clear: step_nr,
item_nr,
cond_count,
cond_type.
step_nr = '710'.
item_nr = '000000'.
cond_count = '01'.
cond_type = 'ZCP2'.
CONDITIONS_IN-ITM_NUMBER = item_nr.
conditions_in-cond_st_no = step_nr.
CONDITIONS_IN-COND_COUNT = cond_count.
CONDITIONS_IN-COND_TYPE = cond_type.
CONDITIONS_IN-COND_VALUE = 666.
CONDITIONS_IN-CURRENCY = 'EUR'.
append conditions_in.
CONDITIONS_INX-ITM_NUMBER = item_nr.
conditions_inx-cond_st_no = step_nr.
CONDITIONS_INX-COND_COUNT = cond_count.
CONDITIONS_INX-COND_TYPE = cond_type.
CONDITIONS_INX-UPDATEFLAG = 'U'.
CONDITIONS_INX-COND_VALUE = 'X'.
CONDITIONS_INX-CURRENCY = 'X'.
append conditions_inx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = salesdocument
ORDER_HEADER_IN = order_header_in
ORDER_HEADER_INX = order_header_inx
LOGIC_SWITCH = logic_switch
TABLES
RETURN = return
CONDITIONS_IN = conditions_in
CONDITIONS_INX = conditions_inx
if return-type ne 'E'.
commit work and wait.
endif.
ENDFORM. " saveTransactionJOCR
Bdc to Bapi
The steps to be followed are :
1. Find out the relevant BAPI (BAPI_SALESORDER_CHANGE for VA02).
[for VA01 use BAPI_SALESORDER_CREATEFROMDAT2]
2. Create a Z program and call the BAPi (same as a Funtion module call).
2. Now, if you see this BAPi, it has
-> Importing structures.
eg: SALESDOCUMENT: this will take the Sales order header data as input.
-> Tables parameters:
eg: ORDER_ITEM_IN: this will take the line item data as input.
Note :
Only specify fields that should be changed
Select these fields by entering an X in the checkboxes
Enter a U in the UPDATEFLAG field
Always specify key fields when changing the data, including in the checkboxes
The configuration is an exception here. If this needs to be changed, you need to complete it again fully.
Maintain quantities and dates in the schedule line data
Possible UPDATEFLAGS:
U = change
D = delete
I = add
Example
1. Delete the whole order
2. Delete order items
3. Change the order
4. Change the configuration
Notes
1. Minimum entry:
You must enter the order number in the SALESDOCUMENT structure.
You must always enter key fields for changes.
You must always specify the update indicator in the ORDER_HEADER_INX.
2. Commit control:
The BAPI does not run a database Commit, which means that the application must trigger the Commit so that the changes are read to the database. To do this, use the BAPI_TRANSACTION_COMMIT BAPI.
For further details... refer to the Function Module documentation for the BAPi.
Bapi to VB(Visual Basic)
Long back I had used the following flow structure to acheive the same.
Report -> SM59 RFC destination -> COM4ABAP -> VB.exe
my report uses the rfc destination to create a COM session with com4abap. com4abap calls the vb.exe and manages the flow of data between sap and vb exe.
You need to have com4abap.exe
If com4abap is installed you will find it in sapgui installatin directory , C:Program FilesSAPpcsapguiRFCSDKcom4abap.
else refer OSS note 419822 for installation of com4abap
after making the settings in com4abap to point to the vb program and setting up rfc destination in sm59 to point to com4abap session , you can use the following function modules to call the vb code.
for setting up com4abap and rfc destination please refer to the documentation for com4abap.
Invoke NEW DCOM session
call function 'BEGIN_COM_SESSION'
exporting
service_dest = service_dest "(this will be a RFC destination created in SM59)
importing
worker_dest = worker_dest
exceptions
connect_to_dcom_service_failed = 1
connect_to_dcom_worker_failed = 2
others = 3.
call function 'create_com_instance' destination worker_dest
exporting
clsid = g_c_clsid
typelib = g_c_typelib
importing
instid = g_f_oid
exceptions
communication_failure = 1 message g_f_msg
system_failure = 2 message g_f_msg
invalid_instance_id = 3
others = 4.
call function 'com_invoke' destination worker_dest
exporting
%instid = g_f_oid
%method = 'UpdatePDF'
sntemp = g_v_const_filent
snsysid = sy-sysid
snflag = 'N'
tables
rssaptable = g_t_pdfdetail1
%return = g_t_pdfdetail1 "t_test
exceptions
communication_failure = 1 message g_f_msg
system_failure = 2 message g_f_msg
invalid_instance_id = 3
others = 4.
then close the com session , using
FM delete_com_instance
FM END_COM_SESSION
BDC
BDC:
Batch Data Communication (BDC) is the process of transferring data from one SAP System to another SAP system or from a non-SAP system to SAP System.
Features :
BDC is an automatic procedure.
This method is used to transfer large amount of data that is available in electronic medium.
BDC can be used primarily when installing the SAP system and when transferring data from a legacy system (external system).
BDC uses normal transaction codes to transfer data.
Types of BDC :
CLASSICAL BATCH INPUT (Session Method)
CALL TRANSACTION
BATCH INPUT METHOD:
This method is also called as CLASSICAL METHOD.
Features:
Asynchronous processing.
Synchronous Processing in database update.
Transfer data for more than one transaction.
Batch input processing log will be generated.
During processing, no transaction is started until the previous transaction has been written to the database.
CALL TRANSACTION METHOD :
This is another method to transfer data from the legacy system.
Features:
Synchronous processing. The system performs a database commit immediately before and after the CALL TRANSACTION USING statement.
Updating the database can be either synchronous or asynchronous. The program specifies the update type.
Transfer data for a single transaction.
Transfers data for a sequence of dialog screens.
No batch input processing log is generated.
For BDC:
http://myweb.dal.ca/hchinni/sap/bdc_home.htm
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&
http://www.sap-img.com/abap/learning-bdc-programming.htm
http://www.sapdevelopment.co.uk/bdc/bdchome.htm
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm
http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
Check these link:
http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
http://www.sap-img.com/abap/question-about-bdc-program.htm
http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
http://www.planetsap.com/bdc_main_page.htm
call Transaction or session method ?
Reward points if useful
Regards
Anji -
Differences between bapi's and bdc
Hi Frendz,
What are the most imp differences between BAPI's and BDC ?
Points for sure...
Thanks in advance
VijayaHi Vijaya,
A few inputs from net
BAPI is used only when it is available for the particular transaction like Delivery Sales order. but BDC can be used for any
transaction which have screen and fields.
BAPI is directly updated the database instead BDC run through the screen flow.
So BAPI can't handle all the flow logic checking and enhancement put by programmer to faciliate the user requirement.
BAPI is a higher end usage for tranfering the data from SAP to non-SAP and vice-versa. for ex: if we are using VB application,where in that we want to connect to SAP and retireve the data,and then change and update the data in SAP for that purpose we can use that.
Apart from that, we can also use it for Uploading/Downloading the data from SAP to Non-SAP like BDC, provided we have an existing BAPI for that.
BAPI function modules will also do all the checks required for data integrity like Transactions for BDC.
There is one more advantage using BAPI instead of BDC.
When we go for upgradation, there might be pozzibility to change the screen elements for transactions depending on the requirement. In that case,our BDC pgm may or may not work (depending on the screen changes they have made). Unless and until we prepare new BDC we cant use the old BDC pgm. But in BAPI, SAP promises that they are going to keep the old BAPI and for new functionality they will provide an upgraded BAPI. Until we write a new BAPI pgm, we can use the exisitng BAPI pgm.
Source: sap-img.com
this somehow summarzes what i wanted to convey and hence have put this extract.. hope it helps to your question.
Br,
Sri
Award points for helpful answers -
I am writing an interactive book and want to use media files and stuff.
I am writing an interactive book and want to use media files and stuff. My question is: If I want to sell this book in the iBookstore,
may I use photos I find on google images and media i find on youtube? Or must all be my own stuff?No ! well not just any photo image or "media". The person who created the photo images has a copyright protection IF he/she wishes to impose it - ditto video and other media.
However if its out of copyright by virtue of age and certain other factors - its considered in "The Public Domain" which is why you see paintings by the Impressionists all over chocolate boxes and posters to name but two!
There are websites offering images donated by the creators and all for free.
Taking and using a picture you do not own copyright and placing online where it can be downloaded is first "publishing" and you need permission and placing in a situation where it can be copied and re-distributed is a breach of copyright.
Look at the tail end credits on any DVD... the above is always included.
Others rmay correct me but Copyright in some countries is vaild from creation until 50 years after the death of the creator. However, that is not always the case. Example, assume I am bequeathed a photo archive and on the last day year 50, I publish a completely new version of the archive, wizzed through Photoshop, cleaned, cropped and modified in other ways.. then I can assert my claim for copyright of the renewed archive, but its a bit more complicated!!!
You can search for "Free Photo Images ( media) , or royalty free images and if you land on a particular website you can ask permission. If you send me a request, my reply will be NO... and you get a warning of dire consequences if your infringe my copyright! Other may be more lenient and in fact feel pretty good to be asked.
A way to get some guidance is to check out Wikipedia and the many images included in its subject matter, check out the copyright status.
Beware of using photo images of paintings in Galleries and Museums, they may have copyright conditions.. but one can always contact them to seek permission.
Search for Copyright and ownership and it should bring up some good information. Depending on your country.. it may have its own Copyright website. USA are more detailed than most, The UK has the 1988 Copyright Act.
Also remember that all photo images carry exif embedded data which among other things carries the copyright information and shows up in a google search for the right keyword! Scanned images processed through Photoshop and other editors can have the metatdata added also. -
Can we cleanse and transform data at flat file or external table level?
Hi,
I have some data that I want to cleanse and transform. I don't want to cleanse it after i populate the external table, I want to get done with it at flat file level or while populating the external table. Can we cleanse and transform data at flat file or external table level through Oracle or OWB 11.2? Is it possible to run a conditional load (i.e. having a where clause or if-else-then) for an external table? Can we call oracle functions for an external table at the time of creation?
Thanks in advance.
Regards,
Ann.Hi Oleg,
Thanks a lot for the clarification. :)
So is there a way that I can clease the data within the text file through Oracle or OWB? I have datatype mismatches in the data and most of my data is getting rejected because of that. The way I can think of, for solving this problem, is to create the external table with all fields with datatype varchar and then cleansing the data. But it doesn't seem very effecient plus it will get very complicated because I have almost 80-90 fields.
Any help?
Thanks and regards,
Ann. -
<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" id="HB_Mail_Container"><tbody><tr width="100%" height="100%"></tr><tr><td height="1" style="font-size: 1pt"></td></tr></tbody></table><blockquote><table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" id="HB_Mail_Container"><tbody><tr width="100%" height="100%"><td id="HB_Focus_Element" width="100%" height="250" valign="top"><p>I initiate a CR XI from a C++ routine using ShellExecute command, the report file is opened and the C++ program continues to execute, this is working fine, now I need the following two things:</p><p>1. When the report is invoked I would like it to run and print the result either to a printer or to a file.</p><p>2. I need to send the report parameters since it will not prompt for it if it runs automatically.</p><p>Thanks in advance for your help.</p></td></tr><tr></tr></tbody></table><blockquote><table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%" id="HB_Mail_Container"><tbody><tr width="100%" height="100%"><td id="HB_Focus_Element" width="100%" height="250" valign="top"><p> </p></td></tr></tbody></table></blockquote></blockquote>
Please re-post if this is still an issue to the Legacy Application Development SDKs Forum or purchase a case and have a dedicated support engineer work with you directly
-
I need to make a report with graphs, and generate an exit file to word
I have to do the acquisition for a laboratory and to make inmediately a report with graphics and a constant test about the method of the experimentation
Probably your best bet is to use ActiveX and control Word from LabVIEW, this way, you can act as you were using Word directly, automating all the steps to create your report. Look for examples in the developer zone, although there will be more examples relating Excel, that can show you the way to act. If you need to use this intensively, i think NI has created a Word toolokit that you can buy.
For any particular question, just ask.
Good luck -
Need to Build the report on Campagins and custom object 01
Hi All,
I am building the report on campaigns and customobject 01 ,But wen i build the report i was not able to get all the project ID that are associated to the campaigns.
The issue is when i pull the campaign id it wont fetches all the ID for customobject01 (becoz the relation is M:M)
Can u please guide how to build the report.
Regards
AnuHi,
you can try to add the metric fields to your report for all involved objects, like # of Campaigns, # of Projects and # of Custom Object 1. Afterwards you can hide these fields from layout. For me this has always helped.
Regards -
Need simple instructions to connect my piano to my mac using usb midi
I purchased a midi in/out usb connection for my Yamaha piano (clavinova clp120) and GB sees a midi device connected (in preferences) but I cant figure out how to use it...
I need simple step by step help.
Thanks!ok, Let me get this correct...
Your piano is already hooked up to the mac via USB and Garage band sees it? correct?
Alright, now, when garageband starts it usually loads the profile for a grand piano or you can select "New Project" > "Piano". If everything goes well you should be able to select the "grand piano" profile and hit record, then you should be able to start playing , do you hear any sound??
If you want to use the LTP lessons then have your piano plugged in and start a lesson. As soon as it loads try hitting a key, do you hear anything?? -
What is report painter? and how to use it
hi all
what is report painter and how we use it.
please send tutorial
thanks & regardshi
Report painter
the below Pdf should help you
http://www.virtuosollc.com/PDF/Get_Reporter.pdf
Regards,
Nitin Aggarwal
Please assign points if its helpful. -
Date and Time in the flat file
Hi All,
I am trying to design a flow which will get data from a flat file. The file has a field which contains both the time and date. How can I handle this in BW? Do I need to creat 2 infoobjects and split the flat file field in start routine or transfer rule? Or is there any stadard infoobject which can hold both the data and time?
Also, the client asked me if I want a .CSV file or .XLS file. Which one is better for uploading into BW? Any PROS and CONS?
Best Regards,Hi,
There is no single Data Type which accepts the Date and Time. Other way is to look the data as CHAR. Else the Update Routine/Formula is the Best
In the Update Rule or Transfer Rule use the Formula
Let the Info Objects be
0date
0Time
The Transfer Rule/ Update Rule Formulas Be
0Date --> LEFT( 8, 'DateTime' )
0Time --> RIGHT(6, 'DateTime')
Then CSV is the best Option to accept the Data as it is ready for Upload
Regards
Happy Tony -
Using flat file to upload in ABAP. Please help. Urgent
Hi all,
I am using a CSV excel file to upload some data to my ABAP program. Thje file contains material numbers as one of the fields. But if I enter the material number 11910892E80, excel converts it to 1.19E+87. Since I am using this file in the program to extract some fields from MARA, i am getting an error 'Material number does not exist'.
I know that we can avoid this problem by changing the format type of the cell to 'text' in excel. I want to know if there is any other way to rectify this problem. I have to use an excel file for upload. Notepad will not do.
Please help me solve this problem. It is urgent.
Thanks and regards,
SwaminathHi
If it is comma delimited file (CSV format) you can directly read the whole file and into a table with one field.
Loop at that table.
Use split a comma into fields of your internal table.
endloop.
Sample code
move pcfile to v_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = v_file
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = in_rec
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.
if sy-subrc ne 0.
write:/5 'Error with PC file'.
endif.
loop at in_rec.
if in_rec(4) ca number.
split in_rec at p_del into
itab-tcode itab-tcodet
itab-saknr
itab-waers1 itab-waers2
itab-amt1 itab-amt2
itab-gl itab-kostl
itab-prctr itab-obukrs
itab-otcode itab-otcodet.
if itab-amt1 = '0.00' or itab-amt1 = space. "skip this line
continue.
endif.
move-corresponding itab to fitab.
append fitab.
clear: itab, fitab.
append itab.
endif.
endloop.
Maybe you are looking for
-
How can I delete an iTunes rental file that bombs on download?
I had a problem with a previously purchased TV episode where the download kept crashing after so many MB. I was able to find and delete the partial file, search for purchases, and complete the download. My wife was jones'n for a chick flick tonight,
-
Can i change my iCloud email address?
am i able to change my email address? I put @icloud.com when i wanted to put @gmail.com ? no underscore... <Email Edited by Host>
-
What is the default password for weblogic 11G for EPM 11.1.2
HI All, Just need to know the default user name and password for weblogic 11G for EPM 11.1.2. At the time of installation I have kept the default user name epm_admin and a password... but its not accepting that user name and password. Any help on the
-
Am I able to upgrade the operating software on my 2009 Macbook Pro to work with Mavericks?
I have a 2009 Macbook Pro with 4 GB of Ram. Am I able to upgrade the software enough to support Mavericks and other software?
-
My navigation bar will only remain in view for one request after using alt key
Everything worked fine for over a year on Mozilla firefox, suddenly I have no navigation or tool bar. If I press the alt key the bar appears and I am able to click on one command and then the bar disapears again. I followed the instructions online an