02-20-2006 8:30 AM
Hi Experts,
I want to create a cutomize BAPI.That has to show all content of CDCHR & CDPOS table. Input parameters are Transaction Code (CDHDR.TCODE) & date (CDHDR.UDATE).
Can anyone help me to do this.
what is the use of this Function module RFC_ABAP_INSTALL_AND_RUN? while executing this function module it is asking Input parameter PROGRAMNAME. i gave program name .but it is showing error " Report/Program statement missing.can any one test FM RFC_ABAP_INSTALL_AND_RUN & inform me whatis the error?
with regadrs,
Silviya T
02-20-2006 8:42 AM
Hi Silviya,
The input parameter PROGRAMNAME in the FM RFC_ABAP_INSTALL_AND_RUN is the program name(which should be unique) with which you will execute the program in the destination server.And in the PROGRAM parameter you will specify the source code which you want to execute and WRITES parameter gets the results from the destination server after executing the source code.
Hope this helps
Thanks
Lakshman
02-20-2006 9:01 AM
Hi Laksman,
i gave the program name as a input parameter eg : Z_AR_DZ_SALES_RECEIPTS_CLR1 in FM RFC_INSTALL_AND_RUN.
but it is showing error.what we have to give inthat program name.
Hi Alvaro,
we cant join Cluster table (CDPOS). then how can we get the all content of CDHDR & CDPOS?please give some idea.give a sample code if possible.
Silviya
02-20-2006 9:08 AM
Hi Silviya,
Please try without giving the program name in the input paramater and pass the source code in PROGRAM parameter.
Thanks
Lakshman
02-20-2006 9:09 AM
Hi Silviya,
Sorry, I didn't notice that CDPOS is a cluster table and cannot be joined... oops! O:-)
Well, there're a couple of ways to do so:
1. use FM's CHANGEDOCUMENT_READ
2. use this code:
select * from cdhdr where ...
select * from cdpos
where OBJECTCLAS = cdhdr-objectclas
and OBJECTID = cdhdr-objectid
and CHANGENR = cdhdr-changenr
endselect.
endselect.
I hope it helps. BR,
Alvaro
02-20-2006 8:47 AM
Hi Silviya,
1. you may just want to select from tables CDHDR and CDPOS, joining fields MANDANT, OBJECTCLAS, OBJECTID and CHANGENR.
2. pls have a look at program RSDB2FIX, Form CHK_SYSTEM.
The goal of FM RFC_ABAP_INSTALL_AND_RUN is to load and run some piece of ABAP program (via table parameter PROGRAM).
I hope it helps. BR,
Alvaro
02-20-2006 9:05 AM
Hi silviya,
1. 2 Fuction Modules are Required.
(They will fetch necessary data from CDHDR,CDPOS)
CHANGEDOCUMENT_READ_HEADERS
CHANGEDOCUMENT_READ_POSITIONS
2. The First FM gives list of all
records ( with change no) which have changed.
3. Loop at the above and the second FM will
provide the details (old-val, new-val) for
each record.
4. While using 1st Fm, i used docclass as 'MATERIAL'.
BCOS
the concept of change documents is applicable
to other type of documents also (depends upon
customization)
regards,
amit m.
02-20-2006 9:16 AM
Hi
- RFC_ABAP_INSTALL_AND_RUN: it allows to create and run a program in remote. You have to transfer the name, but also the code (table PROGRAM).
So you should use that function only if you want to create and run a program doesn't exist in a remote system (for example prod).
It's very hard to test it by SM37, because you have to insert the code of program, it's easier to write a little code inserts an abap code in a internal table and than call that fm.
- BAPI: I think you can create a BAPI or RFC fm that calls fm std as CHANGEDOCUMENT_READ, or CHANGEDOCUMENT_READ_HEADERS and
CHANGEDOCUMENT_READ_POSITIONS
Max