Executing ABAP program in RFC to File
Hi,
In the RFC to File, the RFc is called in the ABAP program.
So when i am executing the ABAP program for the 1st time it doesnt reach PI, only when clicking the execute button multiple times execution reaches PI and a message ID is created along with the required data.
what is the problem? why is it not reaching PI when i execute at the first time itself?
Hi Ravi,
Thanks for the response.
>>> First u have check RFC destinatios wheter it working or not. 1) U r program ID should match with RFc destination and RFC adapter configurations.
I have tested the RFC destinations and it works fine. I have also given the same Program ID in adapter configuration
>>>2)should write commit work at last in the Abap Program.
Commit is present at the end of the ABAP program
Cache refresh was also done. But still facing the same problem.
>>>5)Check in SM58 .
And we are getting the following errors randomly:
Server repository could not create function template for 'ZFN_EXTRACT
Commit fault: com.sap.aii.adapter.rfc.afcommunication.RfcChannelMismatchE
Similar Messages
-
Execute ABAP Program - Error in Open File Cust_Dim.dat
HI All,
I am trying to Implement scenario of Data Service designer for Extract SAP Application data (page no. 181 Onwards). It is for transfer data from SAP ECC - KNA1 to MSSQL table.
I have Data Service server install on my system.
I have implement all the steps. When I execute job server. I am getting error like
"Execute ABAP program <C:/Program Files/Business Objects/BusinessObjects Data Services/ZCUSTDIM_1.aba> error < Open File Error -- C:\Program Files\Business Objects\/Cust_Dim.dat>"
Does anyone knows about this? I have tried to find lot in SDN but didn't find any solution.
Thanks
RatnakarHi all
I was having the exact same problem as the one explained here.
I was a little mixed up because I assigned full privileges on the destination folder to one specific account called installsap
I used this account for installing SAP BO Data Services. This account is the one configured on the Business Objects Data Services Service:
However, I kept getting the same error, as if this account had not enough privileges over the folder.
I saw that there is another Service called Server Intelligent Agent. I went through its configuration Properties by using the Central Configuration Manager, specifically within the Log On As Property and it seemed like a non specific System Account was configured there.
Then I open the services.msc (Windows application) in order to see this very same service configuration and it had NOTHING specified there, nor a Local System Account nor an specific user account.
So, I stopped the service and specified the installsap account I used for the Business Objects Data Services Service. After that I verified I could see this configuration through the Central Configuration Manager and now both tools showed the same.
Then I started the SIA Service retried again executing the ABAP Data Flow and the Error in Open File was gone.
It is how the SIA Service configuration looks like.
By the way, I am not sure if the "Job Server Service" which was cited before in this thread is the same as the Server Intelligence Agent Service I modified
Besides, although I've been using DS for quite a considerable amount of time, I have never heard of such "Job Server Service". Let me know if I am wrong.
Anyways it worked for me and I hope it works for someone else who faces the same error.
Best regards! -
Error in executing ABAP program. Error occurred when creating dataset
hi,
when I use LKM SAP ERP to Oracle (SQLLDR) to extract data from SAP ERP server. I execute my interface, and it's stop at extract data step.
This is message:
java.lang.RuntimeException: Error occured in open tool execute method...Error in executing ABAP program...Error in executing ABAP program...Error occurred when creating dataset/abc/ZODI_13001_6001_GLOBAL.txt
I tried others path name, tried slash or backslash. This is content in code tab
OdiSAPAbapExecute "-UPLOAD=1" "-EXECUTE=1" "-EXECUTEBASE_RKM=0" "-ZRFC_RUN_INSTALL=1" "-ABAP_PROGRAM_NAME=ZODI_13001_6001" "-HOST=10.86.87.24" "-USER=sv_hoa" "-PASSWORD=<@=snpRef.getInfo("SRC_PASS") @>" "-SAP_CLIENT=800" "-SAP_LANGUAGE=EN" "-SAP_SYSTEM_NUMBER=02" "-SAP_FUNCTION_GROUP_NAME=ZODI_FGR_13001" "-CONNECTION_POOL_NAME=SAP_ODI_ERP_POOL_10.86.87.24" "-CONNECTION_POOL_SIZE=10" "-FILE_DELIMITER=<@=""+(char)8@>" "-FILE_NAME=ZODI_13001_6001_GLOBAL.txt" "-FTP_HOST=10.86.82.108" "-FTP_USER=anh" "-FTP_PASSWORD=<@=sFtpPassword@>" "-FTP_PASSIVE_MODE=1" "-FTP_TRANSFER_TIMEOUT=100000" "-ODI_VARIABLE_NAMES=" "-ODI_VARIABLE_VALUES=" "-USER_ABAP_PARAMETER_NAMES=IV_DELIMITER,CHAR3;IV_FILENAME,CHAR255;IV_USER,CHAR35;IV_PWD,CHAR35;IV_HOST,CHAR35;IV_HASHVALUE,CHAR35;IV_PATH,CHAR35;IV_MAX_ROW_CNT,SYTABIX;IV_FETCH_BATCH_SIZE,SYTABIX;" "-USER_ABAP_PARAMETER_VALUES=<Value>" "-USER_ABAP_PARAMETER_SEPARATOR=<Value>" "-ABAP_TABLE_PARAMETERS=RETURN,BAPIRETURN;ET_FILE_RETURN,BAPIRET2" "-ABAP_EXPORT_PARAMETERS=ERRORMESSAGE;SY-MSGV1" "-LOG_FILE_NAME=C:\Users\anh\AppData\Local\Temp\SapAbapExecuteOpenTool_13001.log" "-FTP_PATH=/abc/" "-DEV_CLASS=ZODI_DEVCLASS" "-MAX_ROW_COUNT=" "-FETCH_BATCH_SIZE=100000" "-HASH_VALUE_MARKER=HVM" "-ABAP_PROGRAM_BODY=
*Final Type declarations
TYPES : BEGIN OF ty_final,
Y03HOCSINH_HOCSINH_ID TYPE
Y03HOCSINH-HOCSINH_ID,
Y03HOCSINH_MA_HOC_SINH TYPE
Y03HOCSINH-MA_HOC_SINH,
Y03HOCSINH_TEN_HOC_SINH TYPE
Y03HOCSINH-TEN_HOC_SINH,
Y03HOCSINH_GIOI_TINH TYPE
Y03HOCSINH-GIOI_TINH,
Y03HOCSINH_DIA_CHI TYPE
Y03HOCSINH-DIA_CHI,
Y03HOCSINH_GHI_CHU TYPE
Y03HOCSINH-GHI_CHU,
END OF ty_final.
*Final Temp Type Declarations
TYPES : BEGIN OF ty_final_tmp,
Y03HOCSINH_HOCSINH_ID TYPE
Y03HOCSINH-HOCSINH_ID ,
Y03HOCSINH_MA_HOC_SINH TYPE
Y03HOCSINH-MA_HOC_SINH ,
Y03HOCSINH_TEN_HOC_SINH TYPE
Y03HOCSINH-TEN_HOC_SINH ,
Y03HOCSINH_GIOI_TINH TYPE
Y03HOCSINH-GIOI_TINH ,
Y03HOCSINH_DIA_CHI TYPE
Y03HOCSINH-DIA_CHI ,
Y03HOCSINH_GHI_CHU TYPE
Y03HOCSINH-GHI_CHU ,
END OF ty_final_tmp.
*Final Target Type Declarations
TYPES : BEGIN OF ty_final_target,
C0_Y03HOCSINH_HOCSINH_ID TYPE
Y03HOCSINH-HOCSINH_ID,
C1_Y03HOCSINH_MA_HOC_SINH TYPE
Y03HOCSINH-MA_HOC_SINH,
C2_Y03HOCSINH_TEN_HOC_SINH TYPE
Y03HOCSINH-TEN_HOC_SINH,
C3_Y03HOCSINH_GIOI_TINH TYPE
Y03HOCSINH-GIOI_TINH,
C4_Y03HOCSINH_DIA_CHI TYPE
Y03HOCSINH-DIA_CHI,
C5_Y03HOCSINH_GHI_CHU TYPE
Y03HOCSINH-GHI_CHU,
END OF ty_final_target.
* Table type for Y03HOCSINH
TYPES : BEGIN OF ty_Y03HOCSINH,
HOCSINH_ID TYPE
Y03HOCSINH-HOCSINH_ID,
MA_HOC_SINH TYPE
Y03HOCSINH-MA_HOC_SINH,
TEN_HOC_SINH TYPE
Y03HOCSINH-TEN_HOC_SINH,
GIOI_TINH TYPE
Y03HOCSINH-GIOI_TINH,
DIA_CHI TYPE
Y03HOCSINH-DIA_CHI,
GHI_CHU TYPE
Y03HOCSINH-GHI_CHU,
END OF ty_Y03HOCSINH.
TYPES: BEGIN OF gs_text,
line(843) TYPE c,
END OF gs_text.
*Structure Declarations
DATA: wa_final_string TYPE string,
wa_final TYPE ty_final,
wa_final_target TYPE ty_final_target,
wa_Y03HOCSINH TYPE ty_Y03HOCSINH,
*Table Declarations
tt_final TYPE STANDARD TABLE OF ty_final,
tt_Y03HOCSINH TYPE STANDARD TABLE OF ty_Y03HOCSINH,
tt_final_target TYPE STANDARD TABLE
OF ty_final_target,
tt_final_tmp TYPE STANDARD TABLE OF ty_final_tmp,
tt_final_tmp1 TYPE STANDARD TABLE OF ty_final,
gt_result TYPE STANDARD TABLE OF gs_text,
*Variable Declarations
lv_path TYPE string,
lv_flag TYPE char1,
C0_Y03HOCSINH_HOCSINH_ID TYPE
STRING,
C1_Y03HOCSINH_MA_HOC_SINH TYPE
STRING,
C2_Y03HOCSINH_TEN_HOC_SINH TYPE
STRING,
C3_Y03HOCSINH_GIOI_TINH TYPE
STRING,
C4_Y03HOCSINH_DIA_CHI TYPE
STRING,
C5_Y03HOCSINH_GHI_CHU TYPE
STRING,
wa_final_tmp TYPE ty_final_tmp,
lv_file TYPE string,
lv_datum TYPE sy-datum,
lv_date TYPE char10,
wa_result TYPE string,
lv_delimiter type string,
lv_cnt TYPE sytabix,
*-Cursor Declaration
lv_Y03HOCSINH_dbcur TYPE cursor,
lv_tabix_frm TYPE sy-tabix.
lv_delimiter = iv_delimiter.
IF iv_hashvalue = 'HVM'.
*Open/delete output file
CONCATENATE iv_path iv_filename INTO lv_path.
*Check for file existence, if found, delete it
OPEN DATASET lv_path FOR INPUT
IN TEXT MODE
ENCODING DEFAULT.
IF sy-subrc EQ 0.
DELETE DATASET lv_path.
ENDIF.
*Open/create output file
OPEN DATASET lv_path FOR APPENDING
IN TEXT MODE
ENCODING DEFAULT.
IF sy-subrc EQ 0.
*Batch Processing
OPEN CURSOR WITH HOLD lv_Y03HOCSINH_dbcur FOR
SELECT HOCSINH_ID
MA_HOC_SINH
TEN_HOC_SINH
GIOI_TINH
DIA_CHI
GHI_CHU
FROM Y03HOCSINH.
DO.
*Check for the counter, only for first batch
*process new line is required...
lv_cnt = lv_cnt + 1.
REFRESH tt_Y03HOCSINH.
FETCH NEXT CURSOR lv_Y03HOCSINH_dbcur
APPENDING TABLE tt_Y03HOCSINH
PACKAGE SIZE IV_FETCH_BATCH_SIZE.
IF NOT tt_Y03HOCSINH IS INITIAL.
ELSE.
EXIT.
ENDIF.
LOOP AT tt_Y03HOCSINH INTO wa_Y03HOCSINH.
MOVE wa_Y03HOCSINH-HOCSINH_ID
TO wa_final_tmp-Y03HOCSINH_HOCSINH_ID.
MOVE wa_Y03HOCSINH-MA_HOC_SINH
TO wa_final_tmp-Y03HOCSINH_MA_HOC_SINH.
MOVE wa_Y03HOCSINH-TEN_HOC_SINH
TO wa_final_tmp-Y03HOCSINH_TEN_HOC_SINH.
MOVE wa_Y03HOCSINH-GIOI_TINH
TO wa_final_tmp-Y03HOCSINH_GIOI_TINH.
MOVE wa_Y03HOCSINH-DIA_CHI
TO wa_final_tmp-Y03HOCSINH_DIA_CHI.
MOVE wa_Y03HOCSINH-GHI_CHU
TO wa_final_tmp-Y03HOCSINH_GHI_CHU.
APPEND wa_final_tmp TO tt_final_tmp.
ENDLOOP.
free : tt_Y03HOCSINH.
LOOP AT tt_final_tmp INTO wa_final_tmp.
MOVE wa_final_tmp-Y03HOCSINH_HOCSINH_ID
TO wa_final_target-C0_Y03HOCSINH_HOCSINH_ID.
MOVE wa_final_tmp-Y03HOCSINH_MA_HOC_SINH
TO wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH.
MOVE wa_final_tmp-Y03HOCSINH_TEN_HOC_SINH
TO wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH.
MOVE wa_final_tmp-Y03HOCSINH_GIOI_TINH
TO wa_final_target-C3_Y03HOCSINH_GIOI_TINH.
MOVE wa_final_tmp-Y03HOCSINH_DIA_CHI
TO wa_final_target-C4_Y03HOCSINH_DIA_CHI.
MOVE wa_final_tmp-Y03HOCSINH_GHI_CHU
TO wa_final_target-C5_Y03HOCSINH_GHI_CHU.
Append wa_final_target to tt_final_target.
ENDLOOP.
free : tt_final_tmp.
Clear wa_final_target.
IF NOT iv_max_row_cnt IS INITIAL.
Loop at tt_final_target into
wa_final_target TO iv_max_row_cnt.
MOVE wa_final_target-C0_Y03HOCSINH_HOCSINH_ID
TO C0_Y03HOCSINH_HOCSINH_ID.
MOVE wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH
TO C1_Y03HOCSINH_MA_HOC_SINH.
MOVE wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH
TO C2_Y03HOCSINH_TEN_HOC_SINH.
MOVE wa_final_target-C3_Y03HOCSINH_GIOI_TINH
TO C3_Y03HOCSINH_GIOI_TINH.
MOVE wa_final_target-C4_Y03HOCSINH_DIA_CHI
TO C4_Y03HOCSINH_DIA_CHI.
MOVE wa_final_target-C5_Y03HOCSINH_GHI_CHU
TO C5_Y03HOCSINH_GHI_CHU.
CONCATENATE
C0_Y03HOCSINH_HOCSINH_ID
C1_Y03HOCSINH_MA_HOC_SINH
C2_Y03HOCSINH_TEN_HOC_SINH
C3_Y03HOCSINH_GIOI_TINH
C4_Y03HOCSINH_DIA_CHI
C5_Y03HOCSINH_GHI_CHU
INTO wa_final_string
SEPARATED BY lv_delimiter.
IF sy-tabix EQ 1 AND lv_cnt EQ 1.
CONCATENATE wa_final_string
lv_delimiter INTO wa_final_string.
ELSE.
CONCATENATE '<@=""+(char)8@>' lv_delimiter wa_final_string
lv_delimiter INTO wa_final_string.
ENDIF.
APPEND wa_final_string TO gt_result.
CLEAR : C0_Y03HOCSINH_HOCSINH_ID,
C1_Y03HOCSINH_MA_HOC_SINH,
C2_Y03HOCSINH_TEN_HOC_SINH,
C3_Y03HOCSINH_GIOI_TINH,
C4_Y03HOCSINH_DIA_CHI,
C5_Y03HOCSINH_GHI_CHU.
ENDLOOP.
ELSE.
Loop at tt_final_target into wa_final_target.
MOVE wa_final_target-C0_Y03HOCSINH_HOCSINH_ID
TO C0_Y03HOCSINH_HOCSINH_ID.
MOVE wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH
TO C1_Y03HOCSINH_MA_HOC_SINH.
MOVE wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH
TO C2_Y03HOCSINH_TEN_HOC_SINH.
MOVE wa_final_target-C3_Y03HOCSINH_GIOI_TINH
TO C3_Y03HOCSINH_GIOI_TINH.
MOVE wa_final_target-C4_Y03HOCSINH_DIA_CHI
TO C4_Y03HOCSINH_DIA_CHI.
MOVE wa_final_target-C5_Y03HOCSINH_GHI_CHU
TO C5_Y03HOCSINH_GHI_CHU.
CONCATENATE
C0_Y03HOCSINH_HOCSINH_ID
C1_Y03HOCSINH_MA_HOC_SINH
C2_Y03HOCSINH_TEN_HOC_SINH
C3_Y03HOCSINH_GIOI_TINH
C4_Y03HOCSINH_DIA_CHI
C5_Y03HOCSINH_GHI_CHU
INTO wa_final_string
SEPARATED BY lv_delimiter.
IF sy-tabix EQ 1 AND lv_cnt EQ 1.
CONCATENATE wa_final_string
lv_delimiter INTO wa_final_string.
ELSE.
CONCATENATE '<@=""+(char)8@>' lv_delimiter wa_final_string
lv_delimiter INTO wa_final_string.
ENDIF.
APPEND wa_final_string TO gt_result.
CLEAR : C0_Y03HOCSINH_HOCSINH_ID,
C1_Y03HOCSINH_MA_HOC_SINH,
C2_Y03HOCSINH_TEN_HOC_SINH,
C3_Y03HOCSINH_GIOI_TINH,
C4_Y03HOCSINH_DIA_CHI,
C5_Y03HOCSINH_GHI_CHU.
ENDLOOP.
ENDIF.
free : tt_final_target.
IF NOT gt_result IS INITIAL.
CLEAR wa_result.
LOOP AT gt_result INTO wa_result.
TRANSFER wa_result TO lv_path.
ENDLOOP.
ENDIF.
REFRESH gt_result.
*End of main loop for batching
ENDDO.
*Close dataset
CLOSE DATASET lv_path.
CLOSE CURSOR lv_Y03HOCSINH_dbcur.
ELSE.
DATA: lv_mesg TYPE string.
CLEAR et_file_return.
et_file_return-type = 'E'.
CONCATENATE
'Error occurred when creating dataset' lv_path
INTO lv_mesg.
et_file_return-message = lv_mesg.
Append et_file_return.
ENDIF.
ELSE.
CLEAR et_file_return.
et_file_return-type = 'E'.
et_file_return-message =
'Installed ABAP program does not match interface definition'.
APPEND et_file_return.
ENDIF.
Thanks for helpr u able to figure it out..........i got the same error .......can someone help me fix this issue
-
Hi,I want ABAP program to create an file of this data and to upload in app
Hi Sir/Madam,
I want ABAP program to create an file of this data and to upload in application server.this is urgent requirement.plz reply soon. i'll b thankful to u.
Regards,
VishaliHi ,
Use this abap code .this will create a file in AL11 that you can use .
data: d_msg_text(50),
v_string(20000) type c,
v_filename type rlgrap-filename,
******Create a file on app server
concatenate '<directory name present in AL11 case sensitive>' ' filename.CSV' into v_filename .
condense v_filename no-gaps .
open dataset v_filename for output in text mode
encoding default message d_msg_text.
if sy-subrc ne 0.
write: 'File cannot be opened. Reason:', d_msg_text.
exit.
endif.
****Header for file
concatenate 'information you want to write in file like header etc ' into v_string separated by '|'.
transfer v_string to v_filename.
*****Write data into file by looping an internal table
loop at <internal table > assigning <work area>.
concatenate <work area>-field name1 <work area>-field name2 into v_string separated by '|' .
transfer v_string to v_filename.
endloop.
close dataset v_filename.
Hope this will solve your purpose.
Regards,
Jaya Tiwari -
How to set a Executable ABAP Program to run as a Background Batch Job
Hi
Currently I had a Executable ABAP Program which when executed prompts for user to enter selection once entered and executed it will delete user entered selections from a Table.
Now my requirment is to enhance that program to run it as a BACKGROUND BATCH JOB so that there will be an entry in SM37 when the program is executed
How can i achieve thisHi,
Please refer this link .
It has the steps.
http://sapient.wordpress.com/2007/06/19/how-do-you-set-up-background-jobs-in-sap/
Regards,
SuryaD. -
Execute ABAP program on R3 and export data to BI
Hi All,
I would like to know if there are steps to execute the remote program on R3 side and return the data to BI? I read a few
articles in there but couldn't figure how to do that yet. Could some one point me to the source/documents that I can read about?
Thanks in advance,
TaiIf you have an ABAP program on BW, you can call the Function Module on ECC through RFC and it will retireve the data. Depending on data volume and how sophisticated you want to get, you can even packetize the extraction so as to not put a huge strain on your ECC and BW resources.
This is typically the technology behind how standard content and generic R3/ECC DataSources extract data from an R3/ECC system and into a BW system.
For modeling purposes, if the data you want to extract is on a table in R3/ECC, you'd be better off creating a generic DataSource, if a standard content DataSource doesn't already exist. RFC enabled Function Modules are good for reading flat files on a R3/ECC server to load into BW. -
Sample abap program to create XML files
Hi friends,
IS there is a sample abap program to create an XML file.
regards
kaushikHope the below code is helpfull.....
*& Report ZSAN_XML *
REPORT ZSAN_XML .
* Report ZPRUEBA_MML_13 *
* Export an internal table to XML document *
* NO BORRAR ESTE CODIGO *
*REPORT ZPRUEBA_MML_13.
* PANTALLA SELECCION *
PARAMETERS: GK_RUTA TYPE RLGRAP-FILENAME.
* PANTALLA SELECCION *
* TYPE TURNOS *
TYPES: BEGIN OF TURNOS,
LU LIKE T552A-TPR01,
MA LIKE T552A-TPR01,
MI LIKE T552A-TPR01,
JU LIKE T552A-TPR01,
VI LIKE T552A-TPR01,
SA LIKE T552A-TPR01,
DO LIKE T552A-TPR01,
END OF TURNOS.
* TYPE TURNOS *
* TYPE SOCIO *
TYPES: BEGIN OF SOCIO,
NUMERO LIKE PERNR-PERNR,
REPOSICION LIKE PA0050-ZAUVE,
NOMBRE LIKE PA0002-VORNA,
TURNOS TYPE TURNOS,
END OF SOCIO.
* TYPE SOCIO *
* ESTRUCTURA ACCESOS *
DATA: BEGIN OF ACCESOS OCCURS 0,
SOCIO TYPE SOCIO,
END OF ACCESOS.
* ESTRUCTURA ACCESOS *
* START OF SELECTION *
START-OF-SELECTION.
PERFORM LLENA_ACCESOS.
PERFORM DESCARGA_XML.
END-OF-SELECTION.
* END OF SELECTION *
* FORM LLENA_ACCESOS *
FORM LLENA_ACCESOS.
REFRESH ACCESOS.
CLEAR ACCESOS.
MOVE: '45050' TO ACCESOS-SOCIO-NUMERO,
'MOISES MORENO' TO ACCESOS-SOCIO-NOMBRE,
'0' TO ACCESOS-SOCIO-REPOSICION,
'T1' TO ACCESOS-SOCIO-TURNOS-LU,
'T2' TO ACCESOS-SOCIO-TURNOS-MA,
'T3' TO ACCESOS-SOCIO-TURNOS-MI,
'T4' TO ACCESOS-SOCIO-TURNOS-JU,
'T5' TO ACCESOS-SOCIO-TURNOS-VI,
'T6' TO ACCESOS-SOCIO-TURNOS-SA,
'T7' TO ACCESOS-SOCIO-TURNOS-DO.
APPEND ACCESOS.
CLEAR ACCESOS.
MOVE: '45051' TO ACCESOS-SOCIO-NUMERO,
'RUTH PEÑA' TO ACCESOS-SOCIO-NOMBRE,
'0' TO ACCESOS-SOCIO-REPOSICION,
'T1' TO ACCESOS-SOCIO-TURNOS-LU,
'T2' TO ACCESOS-SOCIO-TURNOS-MA,
'T3' TO ACCESOS-SOCIO-TURNOS-MI,
'T4' TO ACCESOS-SOCIO-TURNOS-JU,
'T5' TO ACCESOS-SOCIO-TURNOS-VI,
'T6' TO ACCESOS-SOCIO-TURNOS-SA,
'T7' TO ACCESOS-SOCIO-TURNOS-DO.
APPEND ACCESOS.
ENDFORM.
* FORM LLENA_ACCESOS *
* FORM DESCARGA_XML *
FORM DESCARGA_XML.
DATA: L_DOM TYPE REF TO IF_IXML_ELEMENT,
M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
G_IXML TYPE REF TO IF_IXML,
W_STRING TYPE XSTRING,
W_SIZE TYPE I,
W_RESULT TYPE I,
W_LINE TYPE STRING,
IT_XML TYPE DCXMLLINES,
S_XML LIKE LINE OF IT_XML,
W_RC LIKE SY-SUBRC.
DATA: XML TYPE DCXMLLINES.
DATA: RC TYPE SY-SUBRC,
BEGIN OF XML_TAB OCCURS 0,
D LIKE LINE OF XML,
END OF XML_TAB.
CLASS CL_IXML DEFINITION LOAD.
G_IXML = CL_IXML=>CREATE( ).
CHECK NOT G_IXML IS INITIAL.
M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
CHECK NOT M_DOCUMENT IS INITIAL.
WRITE: / 'Converting DATA TO DOM 1:'.
CALL FUNCTION 'SDIXML_DATA_TO_DOM'
EXPORTING
NAME = 'ACCESOS'
DATAOBJECT = ACCESOS[]
IMPORTING
DATA_AS_DOM = L_DOM
CHANGING
DOCUMENT = M_DOCUMENT
EXCEPTIONS
ILLEGAL_NAME = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WRITE 'Ok'.
ELSE.
WRITE: 'Err =',
SY-SUBRC.
ENDIF.
CHECK NOT L_DOM IS INITIAL.
W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
IF W_RC IS INITIAL.
WRITE 'Ok'.
ELSE.
WRITE: 'Err =',
W_RC.
ENDIF.
CALL FUNCTION 'SDIXML_DOM_TO_XML'
EXPORTING
DOCUMENT = M_DOCUMENT
IMPORTING
XML_AS_STRING = W_STRING
SIZE = W_SIZE
TABLES
XML_AS_TABLE = IT_XML
EXCEPTIONS
NO_DOCUMENT = 1
OTHERS = 2.
IF SY-SUBRC = 0.
WRITE 'Ok'.
ELSE.
WRITE: 'Err =',
SY-SUBRC.
ENDIF.
LOOP AT IT_XML INTO XML_TAB-D.
APPEND XML_TAB.
ENDLOOP.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = W_SIZE
FILENAME = GK_RUTA
FILETYPE = 'BIN'
TABLES
DATA_TAB = XML_TAB
EXCEPTIONS
OTHERS = 10.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
* FORM DESCARGA_XML * -
Authorization to execute ABAP program
Hi,
I would like to execute one ABAP program, so what authorizations i need to have please le tme know? It is developed by our developers i want to test the program in produvction server.
Thanks
praveenPraveen,
which authorizations you need depend of course on many things.
But if you not will be using the transaction method mentioned earlier in the post you have to extend your own ABAP with own authorization checks.
You can reuse SAP-authorizations or create your own authorizations as well. It all depends on what you are trying to achieve. Some times it is wise to reuse, and some times it is wise to create own authorizations.
http://help.sap.com/erp2005_ehp_03/helpdata/EN/52/67167f439b11d1896f0000e8322d00/frameset.htm
Good luck!
//freppe -
Profile Parameter to execute Abap Program at user logon.
Hi Experts
I've written a small printer selection program to change the users profile parameter.
Is there another profile parameter that can be given to execute this program automatically
when the user logs on.....The reason why I'm looking for a profile parameter to do this is, that only
certain users need to have this happen at logon.
Kind Regards
VicHi Javi,
I don't think you need a custom process chain for this. You can use delivered Process Chain for logic and hard-code your script name in the package. In that script you can call BADI that has your ABAP program inside.
You can find guides how to build BADI here:[How to Pass Parameters to Custom Logic BADI using START_BADI|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20f4252d-98ca-2b10-e689-f85085ae2d12] or here [Creating Custom Script Logic Keyword BADI's - BPC NW|Creating Custom Script Logic Keyword BADI's - BPC NW;.
Method IF_UJ_CUSTOM_LOGIC~EXECUTE has IT_CV as one of parameters. In your script you probably have to use *XDIM_MEMBERSET to get parameters from DM prompt. IT_CV will have all XDIM members.
Please let me know if you have any other questions.
Regards,
Gersh -
Import data from ABAP program to Excell template file
Hello everyone
I have a such task: In abap program I have fields(screen fields), which I want to import into excell file. I don't want to export into empty file but into ready template .xls. Is there any possibility to match corresponding fields?
I really need to know, I will be gratefully for any suggestions.
GreetingsHi Katarzyna ,
something like
DATA: EXCEL TYPE OLE2_OBJECT.
DATA: BOOKS TYPE OLE2_OBJECT.
DATA: BOOK TYPE OLE2_OBJECT.
DATA: CELL TYPE OLE2_OBJECT.
DATA: FONT TYPE OLE2_OBJECT.
DATA: FILE TYPE OLE2_OBJECT.
CREATE OBJECT EXCEL 'EXCEL.APPLICATION'.
CALL METHOD OF EXCEL 'WORKBOOKS' = FILE.
CALL METHOD OF FILE 'OPEN' EXPORTING #1 = P_FILE
#2 = 1.
CALL METHOD OF EXCEL 'CELLS' = CELL EXPORTING #1 = P_LINE
#2 = P_COLUMN.
SET PROPERTY OF CELL 'VALUE' = P_VALUE.
CALL METHOD OF EXCEL 'QUIT'.
This is just a compilation from a complex program. Do some modularization (i.e. create FORM fill_cell using P_line P_column P_value...)
Hope I did not forget anything. Meanwhile we have much more modern and advanced methods and classes - this one is of 2000 (Release 4.5?).
Regards,
Clemens -
How to identify a ABAP program creating a TXT file
Thermal disbursement check process will mimic 0701 which means when F110 is run, a TXT file will be created with epiq format. The file will then place in a special folders in our server for epiq to pick up. I need your help to locate the ABAP program that 0701 uses to generate the TXT file.
Can you please helpHi,
If you are using a report RFFO*, the file is created by subroutines in report RFFORI99. It use commands as OPEN DATASET, CLOSE DATASET and so on.
I hope this helps you
Regards
Eduardo -
Call or Execute, ABAP program with variant
REPORT Z_call_ABAP_program NO STANDARD PAGE HEADING.
TABLES : BKPF , INDX.
PARAMETERS : ZBUKRS LIKE BKPF-BUKRS OBLIGATORY DEFAULT '0001',
ZGJAHR LIKE BKPF-GJAHR OBLIGATORY DEFAULT '1995'.
SELECT-OPTIONS : ZPERIOD FOR BKPF-MONAT OBLIGATORY.
DATA : BEGIN OF CHECK_TAB OCCURS 100,
CLIENT LIKE BSEG-MANDT ,
COMPANY LIKE BKPF-BUKRS ,
FINYR LIKE BKPF-GJAHR ,
MONAT LIKE BKPF-MONAT ,
LDDT LIKE BKPF-CPUDT ,
END OF CHECK_TAB.
DATA : BEGIN OF CHECK_TABO OCCURS 100,
CLIENT LIKE BSEG-MANDT ,
COMPANY LIKE BKPF-BUKRS ,
FINYR LIKE BKPF-GJAHR ,
MONAT LIKE BKPF-MONAT ,
LDDT LIKE BKPF-CPUDT ,
END OF CHECK_TABO.
DATA : BEGIN OF CT_KEY ,
CLIENT LIKE BSEG-MANDT ,
COMPANY LIKE BKPF-BUKRS ,
FINYR LIKE BKPF-GJAHR ,
MONAT LIKE BKPF-MONAT ,
LDDT LIKE BKPF-CPUDT ,
END OF CT_KEY.
START-OF-SELECTION.
IMPORT CHECK_TAB FROM DATABASE INDX(VP) ID 'CDSDATE'.
LOOP AT CHECK_TAB.
MOVE-CORRESPONDING CHECK_TAB TO CHECK_TABO. APPEND CHECK_TABO.
ENDLOOP.
LOOP AT CHECK_TAB.
IF CHECK_TAB-FINYR = ZGJAHR AND CHECK_TAB-MONAT IN ZPERIOD AND
CHECK_TAB-COMPANY = ZBUKRS.
CLEAR CT_KEY.
MOVE: CHECK_TAB-CLIENT TO CT_KEY-CLIENT ,
CHECK_TAB-COMPANY TO CT_KEY-COMPANY,
CHECK_TAB-FINYR TO CT_KEY-FINYR ,
CHECK_TAB-MONAT TO CT_KEY-MONAT ,
CHECK_TAB-LDDT TO CT_KEY-LDDT.
EXPORT : CHECK_TAB CT_KEY TO MEMORY.
SUBMIT ZCDSDTUP
WITH YCLIENT = SY-MANDT
WITH YCOMPANY = ZBUKRS
WITH YFINYR = ZGJAHR
WITH YMONAT = CHECK_TAB-MONAT
WITH YLDDT = CHECK_TAB-LDDT
VIA SELECTION-SCREEN AND RETURN.
IMPORT CHECK_TAB FROM MEMORY .
ENDIF.
ENDLOOP.
SKIP 2.
WRITE :/2 'Position Before Update'. ULINE /2(53).
WRITE :/4 'Client' , 11 'Comp.' , 18 'Fin.Yr.' , 27 'Period' ,
35 'Data Downloaded upto'. SKIP 1.
LOOP AT CHECK_TABO.
IF CHECK_TABO-FINYR = ZGJAHR AND CHECK_TABO-MONAT IN ZPERIOD AND
CHECK_TABO-COMPANY = ZBUKRS.
WRITE :/5 CHECK_TABO-CLIENT,11 CHECK_TABO-COMPANY,19 CHECK_TABO-FINYR,
29 CHECK_TABO-MONAT, 38 CHECK_TABO-LDDT.
ENDIF.
ENDLOOP.
SKIP 3.
WRITE :/2 'Position After Update'. ULINE /2(53).
WRITE :/4 'Client' , 11 'Comp.' , 18 'Fin.Yr.' , 27 'Period' , 35 'Data Downloaded upto'. SKIP 1.
LOOP AT CHECK_TAB.
IF CHECK_TAB-FINYR = ZGJAHR AND CHECK_TAB-MONAT IN ZPERIOD AND
CHECK_TAB-COMPANY = ZBUKRS.
WRITE :/5 CHECK_TAB-CLIENT ,11 CHECK_TAB-COMPANY , 19 CHECK_TAB-FINYR,
29 CHECK_TAB-MONAT , 38 CHECK_TAB-LDDT.
ENDIF.
ENDLOOP.
SKIP 3. ULINE.
WRITE :/7 'PLEASE CONFIRM CAREFULLY THE ABOVE DATES ' ,
/5 'BEFORE RUNNING THE DATA DOWNLOAD PROGRAM FOR CDS.'.
EXPORT CHECK_TAB TO DATABASE INDX(VP) ID 'CDSDATE'.You will haev to add the varaint also in the object entry in the transport request.
For this
goto Se38 - > select progfram - > click on radio button for varaints - > Cick on Display - > Utilities -> transport request - > and execute.
This wil include the varaint also with the program name in the transport request and allow you to directly execute the program after transport to be executed with a varaint.
Regards,
Mansi. -
How to execute application server file from abap program
Hi Friends,
i have a requirement to execute application server file using abap program.
i got a file directory like '/home/im3/hrintf/xxx.sh' , it's of unix file, so they want me to execute through abap program.
pls suggest me with relevant logic.
Thank you.
Regards
Ramesh MDefine the external command in SM49/SM69
Try with SXPG_CALL_SYSTEM or SXPG_COMMAND_EXECUTE
Also check this link
link:[Execute Unix Script|http://searchsap.techtarget.com/tip/0,289483,sid21_gci774071,00.html] -
How can user attach file to interactive form, and be read by abap program?
Hello,
I created an abap interactive form, sent to the user, then user fills out the form fields, then it is uploaded back to sap, then my program reads this data and process it.
It works.
Now I want users to be able to attach any file they want, and the abap program to extract this file out of the PDF, to put it into SAP (or anywhere).
I succeeded in attaching a file, I can "see" it via function module get_annotations, but I get the file in compressed form by Adobe (filter="FlateDecode").
Do you know how to unzip the file, or is there another way to attach files in adobe reader/extract them via abap?
I use acrobat reader 8.1.2
Thx a lot!
sandra
Below is the xml obtained by GET_ANNOTATIONS. We see that there are other text annotations, and that the attached file has {length="98005"}, though real file (before "attach file" to the PDF, and also after "detach file") has length 111 995 bytes. It's why I deduced that there is a compression (I also tried to extract it as-is and open it with adobe but it doesn't work.
<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<annots>
<highlight rect="212.347,624.257996,252.979004,636.539978" creationdate="D:20080604100938+02'00'"
name="2114308b-275d-4eca-8bfc-c8288ef4a77c" color="#FFFF00" flags="print"
date="D:20080604100938+02'00'" title="mtresori" subject="Texte surligne "
coords="215.432999,636.179016,249.893005,636.179016,215.432999,624.619019,249.893005,624.619019"
page="0">
<popup rect="595.276001,516.179016,775.276001,636.179016" flags="print,nozoom,norotate"
open="no" page="0"/>
</highlight>
<fileattachment rect="15.345001,802.841003,29.345001,822.841003"
creationdate="D:20080604101011+02'00'" name="f6e12648-c9b0-4cd1-b08b-82876c8300d7"
color="#4055FF" flags="print,nozoom,norotate" date="D:20080604101019+02'00'" title="mtresori"
subject="Piece jointe" file="SAP_WIDGETS2.pdf" mimetype="application/pdf"
creation="D:20080603112937+02'00'" modification="D:20080603112937+02'00'" size="111995"
checksum="9F846412B510089F7C6DBCC6527C6339" page="0">
<contents-richtext>
<body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.0.2">
<p>SAP_WIDGETS2.pdf</p>
</body>
</contents-richtext>
<data MODE="raw" encoding="hex" length="98005" filter="FlateDecode">
4889CC570B5414D719F651A38EC468D5C6A2980104E528BBF3B8F3B2626405242920020A0AA4AEBB
C3B2BAECEAEEA2A018030A628C8FFA4A0F568F58426A1EF5118FB5266A8D9AA2B16A55044541C5
A62656EBA315935AE8BDB3BBEC2C0BD9D5B39EB3671966FEFBFCE6BF
ETC. (all hexa code is the attached file, but with compression by adobe)
</data>
</fileattachment>
<text rect="96.187408,680.099976,116.186996,698.099976" creationdate="D:20080613144537+02'00'"
name="73360fcf-f5e5-4d5b-9315-fe4c42924300" color="#FFFF00" flags="print,nozoom,norotate"
date="D:20080613144617+02'00'" icon="Comment" title="srossi" subject="Note" page="0">
<contents-richtext>
<body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.0.2">
<p dir="ltr">
<span dir="ltr" style="font-size:10.0pt;text-align:left;color:#000000;
font-weight:normal;font-style:normal">
ffffffffffffffffffffff
</span>
</p>
</body>
</contents-richtext>
<popup rect="595.276001,578.099976,775.276001,698.099976" flags="print,nozoom,norotate"
open="yes" page="0"/>
</text>
<text rect="100,82,120,100" creationdate="D:20080613144627+02'00'" state="Marked"
name="d524b7d5-1a85-4b62-80b3-5875dd152c51"
color="#FFFF00" flags="hidden,print,nozoom,norotate" date="D:20080613144627+02'00'"
icon="Comment" title="srossi" subject="Note"
inreplyto="73360fcf-f5e5-4d5b-9315-fe4c42924300" statemodel="Marked" page="0">
<contents-richtext>
<body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.0.2">
<p>Marked definie par srossi</p>
</body>
</contents-richtext>
<popuprect="595.276001,-20,775.276001,100" flags="print,nozoom,norotate" open="no" page="0"/>
</text>
<text rect="100,82,120,100" creationdate="D:20080613144633+02'00'" state="Accepted"
name="88af2cb6-7516-4f21-81e6-97edc7a85184"
color="#FFFF00" flags="hidden,print,nozoom,norotate" date="D:20080613144633+02'00'" icon="Comment"
title="srossi" subject="Note" inreplyto="d524b7d5-1a85-4b62-80b3-5875dd152c51" statemodel="Review"
page="0">
<contents-richtext>
<body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.0.2">
<p>Accepted definie par srossi</p>
</body>
</contents-richtext>
<popup rect="595.276001,-20,775.276001,100" flags="print,nozoom,norotate" open="no" page="0"/>
</text>
<text rect="100,82,120,100" creationdate="D:20080613144642+02'00'" state="Marked"
name="a8c6b485-c3f9-44e2-ad53-c61b2766d9d5" color="#FFFF00" flags="hidden,print,nozoom,norotate"
date="D:20080613144642+02'00'" icon="Comment" title="srossi" subject="Note"
inreplyto="f6e12648-c9b0-4cd1-b08b-82876c8300d7" statemodel="Marked" page="0">
<contents-richtext>
<body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.0.2">
<p>Marked definie par srossi</p>
</body>
</contents-richtext>
<popup rect="595.276001,-20,775.276001,100" flags="print,nozoom,norotate" open="no" page="0"/>
</text>
<text rect="100,82,120,100" creationdate="D:20080613144647+02'00'" state="Accepted"
name="0136b689-575c-46b8-a21a-86e3c8d73904" color="#FFFF00" flags="hidden,print,nozoom,norotate"
date="D:20080613144647+02'00'" icon="Comment" title="srossi" subject="Note"
inreplyto="a8c6b485-c3f9-44e2-ad53-c61b2766d9d5" statemodel="Review" page="0">
<contents-richtext>
<body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.0.2">
<p>Accepted definie par srossi</p>
</body>
</contents-richtext>
<popup rect="595.276001,-20,775.276001,100" flags="print,nozoom,norotate" open="no" page="0"/>
</text>
<text rect="100,82,120,100" creationdate="D:20080613144657+02'00'" state="Accepted"
name="a21fc3c5-cf6a-4c6f-bc1f-328a91050b4e" color="#FFFF00" flags="hidden,print,nozoom,norotate"
date="D:20080613144657+02'00'" icon="Comment" title="srossi" subject="Note"
inreplyto="2114308b-275d-4eca-8bfc-c8288ef4a77c" statemodel="Review" page="0">
<contents-richtext>
<body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"
xfa:APIVersion="Acrobat:8.0.0" xfa:spec="2.0.2">
<p>Accepted definie par srossi</p>
</body>
</contents-richtext>
<popup rect="595.276001,-20,775.276001,100" flags="print,nozoom,norotate" open="no" page="0"/>
</text>
</annots>
<f href="acTempF-00000028453-00000000089"/>
<ids original="03473EFED11DB2110A00000000000000" modified="959796E85292D54DB7FA558CAAD4A346"/>
</xfdf>Hello everybody,
I am sure you have an answer to my question above. It was :
how is it possible for a user to ATTACH files to a PDF interactive form, and then be able to READ them via a program ? (I guess the solution to read them via ABAP or JAVA is quite the same?)
Thx a lot !
sandra -
Error:Dataflows abap program
Hi,
Dataservices 4.2
Sql server 2008
SAP (4.6
I make a migration of dataservices 11.5 towards 4.2 on new waiter.
when I try to execute my dataflow abap, I have this message error :
error:"RFC Call Receive error<Function/BODS/ABAP_RUB:RFC_ABAP_EXCEPTION( PROGRAM_DOES_NOT_EXIT)aucun numéro de pager n'est généré pour cette adresse
I have make install on the Server SAP 2 functions ( K900187.R22 and R900187.R22) which allowed me to import my SAP tables on the datastore and
reading the data.
I use "execute preloaded " option for execute my dataflows
since migration the dataflows abap do not function any more
it would have installations or configuration has to make on the Server SAP
Somebody has an idea
Thanks youDear Marie,
You will have to have to import the new ABAP Program group "BODS/BOS" which you can find in the local install folder...
Here are some details:
Installing Functions on the SAP Server
SAP BusinessObjects Data Services provides functions that support the use of the ABAP, BAPI, and
IDoc interfaces on SAP servers. You will need some or all of these functions in the normal operation
of the software in an SAP environment. These functions perform such operations as dynamically loading
and executing ABAP programs from Data Services, efficiently running preloaded ABAP programs,
allowing for seamless metadata browsing and importing from SAP servers, and reporting the status of
running jobs. Some of these functions read data from SAP NetWeaver BW sources.
You must upload the provided functions to your SAP server in a production environment. It is
recommended that you always upload the functions to your SAP server whether you are in a
development, test, or production environment. The functions provide seamless integration between
Data Services and SAP servers.
The default installation places two function module files for SAP servers in the ...\Data
Services\Admin\R3_Functions\transport directory. You then upload these files to SAP servers
using the SAP Correction and Transport System (CTS) or manually. Using CTS allows for version
control as the functions evolve across releases.
The installation provides two versions of transport files (depending on the server version you are using)
to install the functions on the SAP server. To obtain the names of the latest transport files for installing
or upgrading these SAP server functions, see the readme.txt file
And I've found those files and text files in the local install folder....in:
Program Files\SAP BusinessObjects\Data Services\admin\R3_Functions
(that's where I've installed it).
There you'll find some descriptive txt as how to proceed.
After installing, it might happen that the executing user is missing some authorizations.
Here my authorizations team helped me by tracing the user and then adding the necessary rights.
Sure hope this will help you.
Notes to check:
see SAP Note 1919255
Note 1916294
Maybe you are looking for
-
I recently installed iOS 5 on my iMac. Pages no longer has the "Save as" command in the file menu. Can anyone help?
-
Hi all, I am new to MM and PM, i need to work on combined mm and pm(i dont want integration and configuration i would just like to know whether if we first work on mm then automatically PM will trigger or if pm then automatically MM will trigger.)...
-
Package manager - question?
Hello folks, I wish to know why Package manager in openSolaris is so slow application. I know that it is written in Python, but I still do not understand why somebody did not offer some patch for that application. I will help honestly in programming
-
hello, I creata a mining model and trained it with some data using the sql table.Now I want that when ever I make any Changes in sqltable record. Then I have to chane the data of mining model also.Please provide help. Thanks in Advance Shalini Rathor
-
Hi All, I have a 3511 MCU on software version 2.0 which I wish to upgrade to version 3.2. When I run the upgrade application I cannot complete the upgrade due to a bad password either when I follow the upgrade procedure, using a null password, or usi