How to upload data into CRM using batch job
Hello,
I got some problem and need some hints.
I am uploading data from a flat text file (product data) into CRM using thefunction module GUI_UPLOAD. My program starts with a selection screen whereI enter the path and the filename of the program, then I click start, and
the data is transferred in CRM. This works perfect, and I can automaticallycreate service products in CRM.
Here comes the PROB:
But now I want to automize this procedure using a batch job that automatically picks up the file from the server and processes it automatically without any user interaction. BUT I always get an error saying that my function module GUI_UPLOAD can't run in batch mode. So
anyone has an idea how to do this? Any other function modules that can run in batch mode? Any other ideas?
Thx very much for ur help on this.
Hi Bill,
GUI_UPLOAD, like the name says, uses the SAPGUI to upload the data to theserver.. and in a batch job, you don't have the connection to a SAPGUI.
So you should use following kind of coding:
DATA MSG(100).
OPEN DATASET "FILENAM" FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE
MSG.
IF sy-subrc = 0.
DO.
READ DATASET "FILENAM" INTO [Your internal table].
IF sy-subrc <> 0.
EXIT.
ENDIF.
APPEND [Your internal table]P_DATA.
ENDDO.
ENDIF.
The file should then be available on the server.
Regards
Similar Messages
-
How to upload data into IT0000 using ABAP-HR program
Hello,
I'm required to upload data into multiple infotypes [IT000, 0001, 0002, etc] using single input text file. Can anyone able to guide me, how to upload data into IT0000 using ABAP program ?
Thanks in advance.
Regards
Prabhakar.
Message was edited by:
Prabhakara MuthyalExample code for HR_MAINTAIN_MASTERDATA to COPY IT0002
DATA: INT_0002_FINAL TYPE STANDARD TABLE OF PA0002 WITH HEADER LINE.
DATA: VALUES LIKE PPROP OCCURS 10 WITH HEADER LINE,
RETURN LIKE BAPIRETURN1,.
LOOP AT INT_0002_FINAL.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-PERNR'.
VALUES-FVAL = INT_0002_FINAL-PERNR.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-BEGDA'.
VALUES-FVAL = INT_0002_FINAL-BEGDA.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-ENDDA'.
VALUES-FVAL = INT_0002_FINAL-ENDDA.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-nachn'.
VALUES-FVAL = INT_0002_FINAL-NACHN.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-gblnd'.
VALUES-FVAL = INT_0002_FINAL-GBLND.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-vorna'.
VALUES-FVAL = INT_0002_FINAL-VORNA.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-rufnm'.
VALUES-FVAL = INT_0002_FINAL-RUFNM.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-name2'.
VALUES-FVAL = INT_0002_FINAL-NAME2.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-inits'.
VALUES-FVAL = INT_0002_FINAL-INITS.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-famst'.
VALUES-FVAL = INT_0002_FINAL-FAMST.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-gbdat'.
VALUES-FVAL = INT_0002_FINAL-GBDAT.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-sprsl'.
VALUES-FVAL = INT_0002_FINAL-SPRSL.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-anzkd'.
VALUES-FVAL = INT_0002_FINAL-ANZKD.
APPEND VALUES.
VALUES-INFTY = '0002'.
VALUES-FNAME = 'P0002-natio'.
VALUES-FVAL = INT_0002_FINAL-NATIO.
APPEND VALUES.
* maintain master data
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
PERNR = INT_0002_FINAL-PERNR
ACTIO = 'COP'
BEGDA = INT_0002_FINAL-BEGDA
* ENDDA = INT_0002_FINAL-ENDDA
SUBTY = SPACE
NO_ENQUEUE = SPACE
DIALOG_MODE = '0'
TCLAS = 'A'
IMPORTING
RETURN1 = RETURN
TABLES
PROPOSED_VALUES = VALUES
* MODIFIED_KEYS =
EXCEPTIONS
OTHERS = 1.
IF RETURN IS INITIAL.
WRITE:/' Done....'.
ELSE.
WRITE:/ RETURN-ID, RETURN-TYPE, RETURN-NUMBER, RETURN-MESSAGE_V1, RETURN-MESSAGE_V2, RETURN-MESSAGE_V3, RETURN-MESSAGE_V4.
ENDIF.
CLEAR VALUES.
REFRESH VALUES.
ENDLOOP. -
Uploading Data Into CRM Using a Batch Job
Hi,
How can I automate the procedure of uploading data from a flat text file (product data) into CRM using the function module GUI_UPLOAD?
Thanks,
Rachita.Hi,
GUI_UPLOAD, like the name says, uses the SAPGUI to upload the data to the server, and in a batch job, you don't have the connection to a SAPGUI. So you should use following kind of coding:
DATA MSG(100).
OPEN DATASET "FILENAM" FOR INPUT IN TEXT MODE ENCODING DEFAULT MESSAGE
MSG.
IF sy-subrc = 0.
DO.
READ DATASET "FILENAM" INTO [Your internal table].
IF sy-subrc <> 0.
EXIT.
ENDIF.
APPEND [Your internal table]P_DATA.
ENDDO.
ENDIF.
Reward points if found helpfull...
Cheers,
Siva. -
How to upload data into form of Oracle EBS R12 using ATS ver 9.0
Hi experts,
Could you please guide me how to upload data into form on Oracle EBS R12 using Oracle Application Testing Suite verson 9.(The simpliest way)
For example: I need to create user account on Oracle EBS. Normally, I use Dataloader to upload the data, however it just can upload one by one record, cannot upload multi record at same time. Moreover if the performance of server is low, so I will get the issue when using dataloader.
Thanks in advance
Best Regards
HieuHi you can create Virtual users to enter data. Note than you have to name the objects accordingly.
For Example default recording provided by Open script is ObjectNAME_(Index No of the object).
when you record one iteration the name of any object would be ObjectNAME_(0)
You can then create virtual users so the index will increment as the total number of Virtual users increases. Also you have to handle which row of your test data would get mapped to which Virtual user in the script run session.
Thanks -
How to upload data into Classification-MM02 for each MATNR By using BAPI
Hi all
How to upload data into characterstic value in classification- MM02 for each MATNR by using BAPI.Hi Siva,
Please try BAPI BAPI_OBJCL_CHANGE.
The object key should be material number and object table should be MARA.
Regards
Hiren K.Chitalia -
How to upload data into ztables
Hi all,
How to upload data into ztables
plz sent the detail description as well sa sample programsHi Narendra,
Sample code to update the Z db table :
REPORT yupload.
TABLES ybtab.
DATA itab LIKE ybtab OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
filename = 'C:\data.txt'
filetype = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = itab
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
INSERT ybtab FROM TABLE itab.
ENDIF.
Schedule this program as a Background Job with required time paramters .
Regards,
Ramganesan K. -
How to upload data into Sharepoint?
Hello Community
Before you use RBS you have to either:
1- Manually upload data into Sharepoint 2013 Server
2- Use a migration tool.
But how do you "manually" upload data into Sharepoint 2013 Server and what is the
recommended tool to use to upload data into Sharepoint 2013 Server
Thank you
ShabeautUploading manually just involves uploading data like you normally would to SharePoint. Drag-and-drop documents into the Document Libraries or use WebDAV to connect to the SharePoint site and copy that way.
As for migration tools, there are plenty out there. ShareGate, Metavis, Metalogix, AvePoint and others have migration tools.
Trevor Seward
Follow or contact me at...
  
This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs. -
How to upload data for me01 using lsmw recording method
*dear expert please tell me the complete procedure for how to upload data in me01 transaction using lsmw recording method.
Moderator Message: Duplicate post locked.
Edited by: Vinod Kumar on May 8, 2011 7:56 PMHi,
To be honest I don't understand your question. When You execute LSMW and create project, then all steps are shown in a very clear way with good description. With which one you have problems?
Best regards
Marcin Cholewczuk -
How to upload data for me01 using LSMW BDC METHOD
*hi export please tell me the complete procedure for uploading data in me01 using LSMW BDC METHOD*
Moderator message: please search for available information/documentation.
Edited by: Thomas Zloch on May 8, 2011 10:06 PMHi,
To be honest I don't understand your question. When You execute LSMW and create project, then all steps are shown in a very clear way with good description. With which one you have problems?
Best regards
Marcin Cholewczuk -
How to upload data into PC cluster
Hi Experts,
Please let me know how do the data into the PC cluster is stored?I mean how the leave from the quota is deducted and the how is PC cluster is updated?
Thanks,
AnkitaHi Narendra,
Sample code to update the Z db table :
REPORT yupload.
TABLES ybtab.
DATA itab LIKE ybtab OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
CODEPAGE = ' '
filename = 'C:\data.txt'
filetype = 'DAT'
HEADLEN = ' '
LINE_EXIT = ' '
TRUNCLEN = ' '
USER_FORM = ' '
USER_PROG = ' '
DAT_D_FORMAT = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = itab
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
INSERT ybtab FROM TABLE itab.
ENDIF.
Schedule this program as a Background Job with required time paramters .
Regards,
Ramganesan K. -
How to send an updated list using batch job
Hi All,
The program displays data on the screen, if the data looks ok, then there is an option to update.
When I run update, the program submits a batch job and the basic list gets updated, but my batch job is still sending the data on the screen. how can i send the updated list using batch job.
Ex: output of the program
1 2
there is an update button on the screen, when i press update button, my program submits in batch job, the above list becomes
1 2
3 4
but when i check the spool, it shows the o/p as 1 2 ..it is not sending the updated list.
Please suggest me how to send the updated data
Thanks,
KumarHi Krishna,
I have added a button on the alv list. when i press update button, my program updates the list, then submits the batch job. I am attaching the sample test program i am trying with, please suggest me how can i get the updated list.
*& Report ZTESTSSSSS
REPORT ZTESTSSSSS.
DATA: gt_fieldcat TYPE slis_fieldcat_alv,
lt_fieldcat type slis_t_fieldcat_alv,
gt_sort TYPE slis_t_sortinfo_alv,
g_repid LIKE sy-repid,
gt_layout TYPE slis_layout_alv.
start-of-selection.
lt_return-type = 'S'.
lt_return-message = 'test message'.
append lt_return.
CLEAR gt_fieldcat.
gt_fieldcat-fieldname = 'TYPE'.
gt_fieldcat-outputlen = '3'.
gt_fieldcat-tabname = 'LT_RETURN'.
gt_fieldcat-seltext_l = 'Type'.
gt_fieldcat-seltext_m = 'Type'.
gt_fieldcat-seltext_s = 'Type'.
APPEND gt_fieldcat TO lt_fieldcat.
CLEAR gt_fieldcat.
gt_fieldcat-fieldname = 'MESSAGE'.
gt_fieldcat-outputlen = '15'.
gt_fieldcat-tabname = 'LT_RETURN'.
gt_fieldcat-seltext_l = 'Message'.
gt_fieldcat-seltext_m = 'Message'.
gt_fieldcat-seltext_s = 'Message'.
APPEND gt_fieldcat TO lt_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_FIELDCAT = lt_fieldcat
TABLES
T_OUTTAB = lt_return
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
*& Form set_pf_status
text
-->RT_EXTAB text
FORM set_pf_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STANDARD'.
ENDFORM. "Set_pf_status
*& Form user_command
text
-->R_UCOMM text
-->RS_SELFIELD text
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA: li_count TYPE I.
IF r_ucomm EQ 'UPD'.
Adding another message
lt_return-type = 'S'.
lt_return-message = 'Another test message'.
APPEND lt_return.
rs_selfield-refresh = 'X'.
rs_selfield-col_stable = 'X'.
rs_selfield-row_stable = 'X'.
l_upd = 'X'.
LOOP AT lt_return.
WRITE: / lt_return-type, lt_return-message.
ENDLOOP.
IF sy-batch IS INITIAL.
l_upd = 'X'.
Open the Job
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = w_name
IMPORTING
jobcount = w_number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc = 0.
SUBMIT ('ZTESTSSSSS') VIA JOB w_name NUMBER w_number
AND RETURN
WITH p_recnnr = p_recnnr.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = w_number
jobname = w_name
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. "User_command
Thanks,
Kumar -
How to upload data into SAP BW Info Objects using SAP XI
Hi,
I need to upload master and hierarchy data into SAP BW Info Objects using SAP XI as EAI.
Can anyone suggest me the best solution to do it.
Thanks in Advance,
Volker.Hi! Have you not checked the BW-XI Integration document? It is available on the main page of the SDN section for XI. Almost all the steps for the integration are there...
-
How to upload data into a database from a csv file in a jsp app?
I can write a HTML form to let users to post a csv file and store it in the web server, then how could I process the file to load the data into a View Obj or an Entity Obj without manually parsing the csv files? Any jsp or java code samples that will do something like the "sqlload" in sqlplus?
I'm using JDev 3.1.1.2. Thanks.Navy_Coder wrote:
6 zebras.But you must marry his eldest daughter as well, for that dowry. -
How to load data into table Using Script Task
We have a directory/folder where we have a file. We need to insert the File Created Date , File Name , Extension into the database table of Sql server by using Script Task.
So could you please suggest , how to frame the connection string , fetch the file details and insert the data into the database table using Script Task of SSIS 2008You can achieve it as follows using standard script task
1. Add a ForEachLoop container to point to your directory to iterate though the files. Add a variable of type string inside loop to get file name of each file it iterates. Choose option Filename and extension. Add a variable to just store extension part
(FileExtension), set EValuateAsExpression true for it and give expression as below
SUBSTRING(@[User::FileName],FINDSTRING(@[User::FileName],".",1)+1,LEN(@[User::FileName]))
2. Add a script task inside loop and pass filename variable as a read only variable to it. Crete a new variable to get creationdate and pass it as ReadWrite. Inside write code as below
Public Sub Main()
' Add your code here
Dim f As New System.IO.FileInfo(Dts.Variables("FileName").Value.ToString())
Dts.Variables("FileCreatedDate").Value = f.CreationTime
Dts.TaskResult = ScriptResults.Success
End Sub
3. Add a Exec SQL Task after Script task inside loop and give a query like below
INSERT INTO TableName (FileName,CreatedDate,Extension)
VALUES(?,?,?)
and in parameter tab map the parameter placeholders 0,1 and 2 to @[User::FileName],@[User::FileCreatedDate] & @[User::FileExtension] variables
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
How to put data into textbox using JSP
How can I put data into a textbox using JSP?
This code prints to a html page but I want it inside an text area:
// Print out the type and file name of each row.
while(ftplrs.next())
int type = ftplrs.getType();
if(type == FtpListResult.DIRECTORY)
out.print("DIR\t");
else if(type == FtpListResult.FILE)
out.print("FILE\t");
else if(type == FtpListResult.LINK)
out.print("LINK\t");
else if(type == FtpListResult.OTHERS)
out.print("OTHER\t");
out.print(ftplrs.getName() +"<br>");
}I have tried with the code below:
<textarea name="showDirectoryContent" rows="10" cols="70">
<%
// Print out the type and file name of each row.
while(ftplrs.next())
int type = ftplrs.getType();
if(type == FtpListResult.DIRECTORY)
%>
<%= "DIR\t" %>
<% else if(type == FtpListResult.FILE) %>
<%= "FILE\t" %>
<% else if(type == FtpListResult.LINK) %>
<%= "LINK\t" %>
<% else if(type == FtpListResult.OTHERS) %>
<%= "OTHER\t" %>
<% String temp = ftplrs.getName() +"<br>");
<%= temp > <br>
%>
</textarea>I get the following error:
Location: /myJSPs/jsp/grid-portal-project/processviewfiles_dir.jsp
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to compile Note: sun.tools.javac.Main has been deprecated.
C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\grid_0002dportal_0002dproject\processviewfiles_dir_3.java:151: 'else' without 'if'.
else if(type == FtpListResult.FILE)
^
C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\grid_0002dportal_0002dproject\processviewfiles_dir_3.java:165: 'else' without 'if'.
else if(type == FtpListResult.LINK)
^
C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\grid_0002dportal_0002dproject\processviewfiles_dir_3.java:179: 'else' without 'if'.
else if(type == FtpListResult.OTHERS)
^
C:\tomcat\jakarta-tomcat-3.3.1\work\DEFAULT\myJSPs\jsp\grid_0002dportal_0002dproject\processviewfiles_dir_3.java:193: ';' expected.
String temp = ftplrs.getName() +"");
^
4 errors, 1 warning
at org.apache.tomcat.facade.JasperLiaison.javac(JspInterceptor.java:898)
at org.apache.tomcat.facade.JasperLiaison.processJspFile(JspInterceptor.java:733)
at org.apache.tomcat.facade.JspInterceptor.requestMap(JspInterceptor.java:506)
at org.apache.tomcat.core.ContextManager.processRequest(ContextManager.java:968)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:875)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
at java.lang.Thread.run(Thread.java:536)
Please help???Yes indeed this works:
<textarea name="showDirectoryContent" rows="10" cols="70">
<%
// Print out the type and file name of each row.
while(ftplrs.next())
int type = ftplrs.getType();
if(type == FtpListResult.DIRECTORY)
{%>
<%= "DIR\t" %>
<%} else if(type == FtpListResult.FILE) {%>
<%= "FILE\t" %>
<%} else if(type == FtpListResult.LINK) {%>
<%= "LINK\t" %>
<%} else if(type == FtpListResult.OTHERS) %>
<%= "OTHER\t" %>
<%= ftplrs.getName() %>
<%
%>
Maybe you are looking for
-
More than one VI at a time (i.e. multitasking)
Hello. I currently work in a lab where we use LabVIEW to control an multifunction instrument. We use the sofware both for data acquisition (through Ni-DAQ) and for physical control of things like stages, and frequency generators (e.g. through GPIB).
-
How do I set up my iMac g4 to the Internet?
How do I set up my iMac g4 to the Internet?
-
Lync 2011 for Mac not saving conversation history on outlook 2011
I have MS Office 2011 on my MAC. I have noticed the conversation history is saved on the MS Lync History folder on the MAC. However the outlook mailbox folder called " conversation history " is not updated with this info. Any idea what could be happ
-
My phone is stuck on the loading bar
my torch 9810 is stuck on the loading bar i have tried the safe mode and it didnt work and i wanted to know if there is any other thing i can do..........its been 2 days without my phone and its hell.......i need all my contacts someone help me plz
-
hi all, this is my very first post so please have indulgence i've been wondering is there a way to disable autoscrolling in an exported pdf? what i want to achieve is an interactive multipage pdf, where pages can be turned only after pressing a dedic