How to call a idoc in abap program and updates catsdb table
how to call a idoc in abap program and updates catsdb table
thank you,
Jagrut BharatKumar Shukla
Hi Kishan,
You can refer to following help document,
http://help.sap.com/saphelp_nw04/helpdata/en/bf/d005244e9d1d4d92b2fe7935556b4c/content.htm
Regards,
Meera
Similar Messages
-
How to call subroutines defined in ABAP program with type S
how to call subroutines defined in ABAP program with type S? can you give an example?
Normal executable program,
REPORT ZTEST_MAIN.
perform sub1 in program ztest_sub.
"you can call using in program addition
Subroutine pool program
PROGRAM ZTEST_SUB.
form sub1.
endform. -
How to call transaction in an abap program
how do we open a transaction thru an abap program and pass a parameter to it
Use call transaction. You can fill up the parameters in the BDC internal table
DATA: bdc_tab LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
CONSTANTS: c_tcode LIKE t130m-tcode VALUE 'FB01'. "Tcode you want to call
CALL TRANSACTION c_tcode
USING bdc_tab
MODE 'N'
UPDATE 'S'
MESSAGES INTO messtab.
Error message will be captured in the messtab.
You can goto the SAP help on Call transaction to see all the details and options.
<b><REMOVED BY MODERATOR></b>
Thanks.
Message was edited by:
Alvaro Tejada Galindo -
How to call the webservice in abap program
Hi All,
I have created a web service for my RFC . The RFC has Import and export paramaters.
I want call the same web service into my ABAP REPORT and at the same time i want pass the values to webservice and get the result from webservice in my abap report,
Please help me how to call the web service and pass the values and get the values?
Highly appreciate your assitance.
Thanks,
KishanHi Kishan,
You can refer to following help document,
http://help.sap.com/saphelp_nw04/helpdata/en/bf/d005244e9d1d4d92b2fe7935556b4c/content.htm
Regards,
Meera -
How to call BAPI_XBP_JOB_START_IMMEDIATELY in the ABAP program
Dear all,
I call the function 'BAPI_XBP_JOB_START_IMMEDIATELY' to release the backgroud jobs. It does not work. it's remote enable function. Should I use call function 'XXX' destination 'XXX' to call it? How can I check the destination? Thanks for your answer.Hi,
if the Function module is remotely enabled also, we can call that from same system.If u want to use destination give destination 'NONE',otherwise no need to give destination.
Regards,
Jyothi. -
How To call a Tcode From a Program and returning back ?
Dear All,
I have a requirement, i have to show all the open orders as in the the tcode va05 and return back to the my program. so how to display the tcode and getting back to my program. please help?Hi,
Basic syntax to call the transaction is:
SET PARAMETER ID <id name> FIELD <filedname>.
CALL TRANSACTION <TCOde> AND SKIP FIRST SCREEN.
If your are using ALV then snippet is :
FORM user_command USING okcode LIKE sy-ucomm
lselfield TYPE slis_selfield.
CASE okcode.
WHEN '&IC1'. " SAP standard code for double-clicking
CASE lselfield-sel_tab_field."check if double click is only on
WHEN 'ITAB-AUFNR'."aufnr not on any other field
SET PARAMETER ID 'ANR' FIELD lselfield-value.
CALL TRANSACTION 'IW32' AND SKIP FIRST SCREEN.
ENDCASE.
ENDCASE.
Endform.
Pooja -
How Can I perform the external abap programe transmit the internal table in
Hi,all
In Sapscript,I want calculate a internal table and return the changed table to Sapscript
I know used the transmit result variable for example:
/:PERFORM GET_MAKTX IN PROGRAM ZXX
/:USING &MATNR&
/:CHANGING &MAKTX&
/:ENDPERFORM.
How can I set Using with a table?
Thanks
SunHi,
As per my knowledge it is not possible to pass the entire table at a time using PERFORM in PROGRAM ,,, USING and CHANGING.
Solutions:
1) If possible do the same thing in the Print Program:
using CONTROL_FORM call element and print in the script
2) if you know the all table entries.: Pass all records at time:
Ex: PERFORM Pxxxx in PROGRAM PROGXXXX
USING <MATNR1>
<MATNR2>
<MATNR3>..............
CHANGING < MAKTX1>
<MAKTX2>
<MAKTX3>............
ENDPERFORM -
How to use KAUF_AUFNR_CHANGE to change Process order and Update a field
Hello ,
I am working on 4.6C system and I hve a requirement to change Process order and Update a field value passed from a ABAP Program. I am looking for suitable Function modules or Bapi ( available in 4.6c) .
I have come across FM KAUF_AUFNR_CHANGE . Would appreciate any guidance on how to use the FM in my program and Update a field in the Process order.
Many Thanks!All the importing parameters of this function module have a striaght structure of the transperent tables...
i have checked the code and it has a modify statement based on the importing parameter..
pick one record in databas and pass it to the importing parameters, with some values changed...
i think that should work
what values to pass the import values of FM -KAUF_AUFNR_CHANGE.
Edited by: ssm on Aug 4, 2011 7:19 PM -
Creation of IDOC through abap program.
hello all,
I hav created idoc through abap program. I hav used FM 'Master_idoc _distrribute'.this program creates an idoc but giving status 30. can any one tell me how to get status 03. I hav already created port, Logical sys,partner no.,distribution model.
My Program is as follows:
ABLES : CRMD_ORDERADM_I,CRMD_ORDERADM_H,CRMD_SCHEDLIN.
DATA : S_CTRL_REC LIKE EDIDC OCCURS 0 WITH HEADER LINE,"Idoc Control Record
ORDER_NO TYPE CRMT_OBJECT_ID VALUE '5000000032'," SEGMENT ORDER DATA
PRODUCT TYPE CRMT_ORDERED_PROD VALUE 'SRV_01',
QUANTITY TYPE CRMT_SCHEDLIN_QUAN VALUE '1.000'.
DATA : ZORDER LIKE ZORDER_NUM OCCURS 0 WITH HEADER LINE.
DATA : T_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE. "Data Records
DATA : T_COMM_IDOC LIKE EDIDC OCCURS 0 WITH HEADER LINE. "Generated Communication IDOc
CONSTANTS :
C_ZRZSEG1 LIKE EDIDD-SEGNAM VALUE 'ZORDER_NUM'.
PARAMETERS : C_MESTYP LIKE EDIDC-MESTYP DEFAULT 'ZORDER_IDOC2', "Message Type
C_RCVPRT LIKE EDIDC-RCVPRT DEFAULT 'LS', "Partner type of receiver
C_LOGSYS LIKE EDIDC-RCVPRN DEFAULT 'BSNL_OUT',
C_RCVPOR LIKE EDIDC-RCVPOR DEFAULT 'A000000006',
C_SNDPOR LIKE EDIDC-SNDPOR DEFAULT 'SAPBCD0000',
C_SNDPRN LIKE EDIDC-SNDPRN DEFAULT 'BCDCLNT100',
C_IDOCTP LIKE EDIDC-IDOCTP DEFAULT 'ZORDER2',
C_SNDPRT LIKE EDIDC-SNDPRT DEFAULT 'LS'. "Destination System
***START-OF-SELECTION
START-OF-SELECTION.
PERFORM GENERATE_CONTROL_RECORD.
PERFORM SEND_IDOC.
*& Form generate_control_record
FORM GENERATE_CONTROL_RECORD .
S_CTRL_REC-RCVPOR = C_RCVPOR. "Receiver Port
S_CTRL_REC-MESTYP = C_MESTYP. "Message type
S_CTRL_REC-IDOCTP = C_IDOCTP. "Basic IDOC type
S_CTRL_REC-RCVPRT = C_RCVPRT. "Partner type of receiver
S_CTRL_REC-SNDPOR = C_SNDPOR. "SENDER PORT
S_CTRL_REC-RCVPRN = C_LOGSYS. "Partner number of receiver
S_CTRL_REC-SNDPRT = C_SNDPRT. "Sender Partner type
S_CTRL_REC-SNDPRN = C_SNDPRN. "Sender Partner Number
APPEND S_CTRL_REC.
ENDFORM. " generate_control_record
*& Form send_idoc
FORM SEND_IDOC.
ZORDER-ORDER_NO = ORDER_NO.
ZORDER-PRODUCT = PRODUCT.
ZORDER-QUANTITY = QUANTITY.
APPEND ZORDER.
T_EDIDD-SEGNAM = C_ZRZSEG1.
T_EDIDD-SDATA = ZORDER.
APPEND T_EDIDD.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
MASTER_IDOC_CONTROL = S_CTRL_REC
TABLES
COMMUNICATION_IDOC_CONTROL = T_COMM_IDOC
MASTER_IDOC_DATA = T_EDIDD
EXCEPTIONS
ERROR_IN_IDOC_CONTROL = 1
ERROR_WRITING_IDOC_STATUS = 2
ERROR_IN_IDOC_DATA = 3
SENDING_LOGICAL_SYSTEM_UNKNOWN = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
COMMIT WORK.
LOOP AT T_COMM_IDOC.
WRITE:/ 'IDoc Generated - ', T_COMM_IDOC-DOCNUM.
ENDLOOP.
ENDIF.
ENDFORM. " send_idoc
I hav created segment , basic type,message typealso and release also .I also linked them.
Plz help me.
HemlataHi Hemalatha,
Just call this Progream RSEOUT00 from your Zprogram and pass the basic parameters like IDOC number, Basic type,Partner number etc.
You can check the parameters by executing the Program RSEOUT00.
This Program will change the status of your IDOC 30 to 03.
Thanks.
Note:Reward Points if you find useful. -
Creating IDOC from ABAP Program
Hi folks,
Could any one tell me the procedure how to process IDOC form ABAP program. for example i want to send MATMAS idoc to other system. now we are able to send through Tcode BD10 to XI. we jsut want to send through ABAP program. is it possible to do so..if so could u pls let me know the procedure..thanks in advance.
santosh.Just check abap program RBDSEMAT.
In short:
- select the materials you want to send.
- call following function module:
CALL FUNCTION 'MG_IDOC_CREATE_FULL_MAT'
EXPORTING
rcvpfc = ' '
rcvprn = receiver_prn
rcvprt = receiver_prt
sndpfc = ' '
sndprn = ' '
sndprt = ' '
message_type = mestyp
TABLES
marakey = t_matkeypack
EXCEPTIONS
OTHERS = 0. -
Sending IDOCS from ABAP Program
hi friends,
can we send IDOC ( of type MATMAS) form ABAP Program. if it possible how can we send, are there any function modules to do so....could any one tell me the procedure to accomplish the task...i have finished the configuration sting in both reciver and sender systems....just need to send material in form of IDOC from abap program.
( Note: not form BD10).
Thanks in advance,
Santosh.Hi,
Follow this code it will help u...
This is for the user created IDOC but as u are making use of ur own basic type i.e., Idoc type MATMAS05
and u can write the code.
*& Report ZZ_Program_To_Create_Idoc
report zz_program_to_create_idoc .
tables: ekko,ekpo.
selection-screen skip 3.
selection-screen begin of block b1 with frame title titl.
selection-screen skip.
select-options s_ebeln for ekko-ebeln.
selection-screen skip.
selection-screen end of block b1.
data: header_segment_name like edidd-segnam value 'Z1EKKO',
item_segment_name like edidd-segnam value 'Z1EKPO',
idoc_name like edidc-idoctp value 'Z19838IDOC1'.
data: header_segment_data like z1ekko,
item_segment_data like z1ekpo.
data: control_record like edidc.
data: messagetyp like edmsg-msgtyp value 'ZZ9838MESG1'.
data: i_communication like edidc occurs 0 with header line,
i_data like edidd occurs 0 with header line.
data: begin of i_ekko occurs 0,
ebeln like ekko-ebeln,
aedat like ekko-aedat,
bukrs like ekko-bukrs,
bsart like ekko-bsart,
lifnr like ekko-lifnr,
end of i_ekko.
data: begin of i_ekpo occurs 0,
ebelp like ekpo-ebelp,
matnr like ekpo-matnr,
menge like ekpo-menge,
meins like ekpo-meins,
netpr like ekpo-netpr,
end of i_ekpo.
start-of-selection.
select ebeln aedat bukrs bsart lifnr from ekko
into table i_ekko where ebeln in s_ebeln.
select ebelp
matnr
menge
meins
netpr
from ekpo
into table i_ekpo
where ebeln in s_ebeln.
control_record-mestyp = messagetyp.
control_record-rcvprt = 'LS'.
control_record-idoctp = idoc_name.
control_record-rcvprn = '0MART800'.
loop at i_ekko.
header_segment_data-ebeln = i_ekko-ebeln.
header_segment_data-aedat = i_ekko-aedat.
header_segment_data-bukrs = i_ekko-bukrs.
header_segment_data-bsart = i_ekko-bsart.
header_segment_data-lifnr = i_ekko-lifnr.
i_data-segnam = header_segment_name.
i_data-sdata = header_segment_data.
append i_data.
select ebelp
matnr
menge
meins
netpr
from ekpo
into table i_ekpo
where ebeln = i_ekko-ebeln.
loop at i_ekpo.
item_segment_data-ebelp = i_ekpo-ebelp.
item_segment_data-matnr = i_ekpo-matnr.
item_segment_data-menge = i_ekpo-menge.
item_segment_data-meins = i_ekpo-meins.
item_segment_data-netpr = i_ekpo-netpr.
i_data-segnam = item_segment_name.
i_data-sdata = item_segment_data.
append i_data.
endloop.
clear i_ekpo.
refresh i_ekpo.
endloop.
call function 'MASTER_IDOC_DISTRIBUTE'
exporting
master_idoc_control = control_record
OBJ_TYPE = ''
CHNUM = ''
tables
communication_idoc_control = i_communication
master_idoc_data = i_data
exceptions
error_in_idoc_control = 1
error_writing_idoc_status = 2
error_in_idoc_data = 3
sending_logical_system_unknown = 4
others = 5
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
loop at i_communication.
write: 'IDOC GENERATED', i_communication-docnum.
endloop.
commit work.
endif.
initialization.
titl = 'ENTER THE PURCHASE ORDER NUMBER'. -
File to File and then Call ABAP Program and pass file name and location
Hi
I am new to PI and am working on the following requirement and some guidance would help:
A file is picked up from a third party server using FTP and is put in an SAP server in a specific location. After I have put in the file successfully, I need to call an ABAP program and provide the name and location of the file for further processing by the ABAP program.
Although I am familiar with File to File, how can I add in the ABAP call with the filename and location? I do not want to pass any other information to the ABAP program.
Thanks for your help.
ManojI think I get what you're saying. This additional file would have the file and the path in it's content. I would then use this as a source (FCC?) for Mapping with the RFC. Right?
Exactly and yes, FCC would be helpful
Would you have a sample OS script to do the above?
Actually it depends on the operating system on which your PI system is standing. For instance for Windows, you might try with the following as a start point (but I was not able to test it, so I can't guarantee it will do the job):
cmd.exe /C "%f %F > C:\target_directory\%DATE%_%TIME%.txt"
In case you needed more, try googling on "windows batch script" or similar.
Hope this helps,
Greg -
How to call a Method in a Program?
Hello,
I am very new to the ABAP world. I have been given a task to call a method if_hrbas_plain_infotype_access~read_single from the class CL_HRBAS_PLAIN_INFOTYPE_ACCESS in a program to see if we can use it to display some employee information. I don't know how to call a method in a program. Can somebody please provide me some pseudo code or instructions?
Thanks.Hi Shan,
here is the code to call a method. while calling the method Instance as 'r_info' which is the type reference to class as specified.
pass the values to exporting parameters plvar,otype,objid...etc according to the requirement
infotypes: 0002. " creates an internal table p0002.
data:
r_info type ref to CL_HRBAS_PLAIN_INFOTYPE_ACCESS.
TRY.
CALL METHOD r_info->if_hrbas_plain_infotype_access~read
EXPORTING
plvar =
otype =
objid =
istat =
infty =
* SUBTY =
begda =
endda =
no_auth_check = 'X'
message_handler =
IMPORTING
PNNNN_TAB = P0002
* HRTNNNN_TAB =
* IS_OK =
CATCH CX_HRBAS_VIOLATED_ASSERTION .
ENDTRY.
LOOP AT P0002.
WRITE:/
P0002-VORNA,
P0002-NCHMC,
P0002-NACHN.
ENDLOOP.
Regards -
Call SXPG _ CALL _ SYSTEM from ABAP program
Hi,
Someone may help me? I need to call the function module SXPG _ CALL _ SYSTEM from ABAP program for to encrypt a file.
I created the command by SM49 , but I don't know how I can call it from ABAP program.
Thanks
Maria CHi Maria.
This is a possible code you can use:
DATA: log LIKE TABLE OF btcxpm WITH HEADER LINE.
Can contain STDOUT, STDERR
commandname =
CALL FUNCTION SXPG_CALL_SYSTEM
IMPORTING
COMMANDNAME = commandname
PARAMETERS = parameters
EXPORTING
STATUS = status
TABLES
EXEC_PROTOCOL = log
EXCEPTIONS
NO_PERMISSION = 1
COMMAND_NOT_FOUND = 2
PARAMETERS_TOO_LONG = 3
SECURITY_RISK = 4
WRONG_CHECK_CALL_INTERFACE = 5
PROGRAM_START_ERROR = 6
PROGRAM_TERMINATION_ERROR = 7
X_ERROR = 8
PARAMETER_EXPECTED = 9
TOO_MANY_PARAMETERS = 10
ILLEGAL_COMMAND = 11
OTHERS = 12.
The following are the comments of the parameters taken from:
http://help.sap.com/saphelp_40b/helpdata/en/fa/0971ee543b11d1898e0000e8322d00/content.htm
Parameters
IMPORTING Parameters
Parameter name
Use
COMMANDNAME
The name of the definition of the external command, as specified in the maintenance function (transaction SM69).
PARAMETERS
Arguments for the external command as specified by the definition in the R/3 System and by the calling program or user.
These arguments are checked for impermissible characters, such as the ; under UNIX. Problems are registered with the SECURITY_RISK exception.
EXPORTING Parameters
Parameter name
Use
STATUS
Returns the final status of the execution of the external command:
· Value O: The external command was started and ran to end successfully.
· Value E: An error occurred; the external command was not run successfully.
Tables Parameters
Parameter name
Use
EXEC_PROTOCOL
Contains the STDOUT and STDERR output of the external command and any output from the target host system.
Exceptions
Exception name
Meaning
X_ERROR
Reserved for future use.
NO_PERMISSION
The AUTHORITY-CHECK of the users authorization for the authorization object S_LOG_COM failed. The user is not authorized to carry out the command named with the specified arguments on the target system.
COMMAND_NOT_FOUND
Command name, as identified by COMMANDNAME and OPERATINGSYSTEM, has not been defined in the maintenance function (transaction SM69).
PARAMETERS_TOO_LONG
The combined argument string (ADDITIONAL_PARAMETERS and the DEFINED_PARAMETERS, as returned in ALL_PARAMETERS) exceeds the limit of 128 characters in length.
SECURITY_RISK
Either:
· The command contains impermissible characters. These are characters with potentially dangerous properties, such as ; under UNIX.
· The command definition specifies that an extra-check function module be run. This function module has rejected execution of the command.
WRONG_CHECK_CALL_
INTERFACE
The command definition specifies that an extra-check function module is to be run. Either this function module is missing, or the interface defined for this function module does not match that of the standard R/3 function module SXPG_DUMMY_COMMAND_CHECK. For more information, please see SXPG_DUMMY_COMMAND_CHECK: Interface for Extra-Check Function Modules.
TOO_MANY_PARAMETERS
The command definition specifies that user-specified arguments for the external command are not allowed. However, an additional string of command arguments was specified.
PARAMETER_EXPECTED
The command definition includes the placeholder character ?, which signifies that additional user-defined arguments are required. However, no additional arguments string was supplied.
PROGRAM_START_ERROR
An error occurred while starting the external command. The R/3 system field SY-MSGV1 contains additional information on the problem.
PROGRAM_TERMINATION_
ERROR
An error occurred while trying to obtain the return code of the external program. The R/3 system field SY-MSGV1 contains additional information on the problem.
ILLEGAL_COMMAND
The external command definition was modified "illegally". That is, the command was not modified by means of the maintenance function (transaction SM69).
The modified command is registered in the system log in its substituted form. The message is registered under the system log ID "LC".
OTHERS
Catch any new exceptions added to this function module.
Hope this will be useful.
Sandro Lombardo -
How to debug the method in abap program
How to debug the method in abap program ?
Could you please give the solution.
Thanks
saiHi ,
Place break point at call method .
It takes u in to the method implementation .
Here u can analyse the method implementation ...
Reward if useful
Thanks
Jagadeesh.G
Maybe you are looking for
-
How to convert an AVI frame to an image data cluster ?
Hi everybody, I have previous VIs that manipulate pictures (image data cluster) readen from JPEG files. I'd like to use these VIs to analyse individual frames from an AVI file. How can I connect the image out of the IMAQ AVI read.vi to the picture in
-
InDesign 2014 CC crashes every time I try to export to pdf
This started happening after I updated to OSX Yosemite. When I try to export a pdf (just a 4 page file, not even any images) InDesign crashes. The Problem report says : Application Specific Information: *** Terminating app due to uncaught exception '
-
Please help in Stored procedure? Psoting third time Urgent!!!
Hi, We are running websphere3.5.3 on AS/400 machine with DB2Connect as local database. I am using com.ibm.db2.jdbc.app.DB2Driver We are trying to execute a servlet with stroedprocedure in it. In the bottom, I included complete error. Can some one hel
-
Hi, I'm very new in Oracle Report... Does anybody know how to generate a running number in oracle report? for eg. 1,2,3,4.... Is there anyway to format these running number to i,ii,iii,iv,v,vi.... or a,b,c,d,e.... Thanks
-
"Installer failed to initialize" and Adobe Support Advisor HELP!
I have tried downloading a trial of Photoshop Elements 11 and previously a trial of Adobe Photoshop CS6. Each time I get to the step where I launch the installer for the application, a box shows up saying, "Installer failed to initialize. Please down