09-09-2014 6:59 AM
Hello,
My requirement is to create a Ztable which will store the Hisotry / change log of data.
I have a program where i am using insert / update for a database table LFBW and displaying the log in the ALV ouput.
I need the same to be updated on Transaction level of FK02 (where entries of Table LFBW gets reflected).
so can any1 suggest me how this can be achieved?
If there is no way to store change history while insert /update on database table from prgram level then what type of z table(Type of Delivery Class ?
Data class ? i should create for the same
Thanks,
Anoop
09-09-2014 7:38 AM
Do not update LFBW with (wild) Open SQL statements, but use standard tools and the change documents will be created
NB: Do not confuse change document (generated in program, look at transaction SCDO - object KRED) and log of change data (generated by Open SQL statements)
A "bad" solution would be usage of SQL statement and call of FM which write the change document (KRED_WRITE_DOCUMENT)
Regards,
Raymond
09-09-2014 7:38 AM
Do not update LFBW with (wild) Open SQL statements, but use standard tools and the change documents will be created
NB: Do not confuse change document (generated in program, look at transaction SCDO - object KRED) and log of change data (generated by Open SQL statements)
A "bad" solution would be usage of SQL statement and call of FM which write the change document (KRED_WRITE_DOCUMENT)
Regards,
Raymond
09-09-2014 8:02 AM
Thanks Raymond Giuseppi
* BDC
=> i tried with the BDC part but facing program while updating the existing withholding tax type (Tcode: FK02)
Could you please provide the BDC recoding for Fk02 (requirement to update / insert withholding tax type)
* Class VMD_EI_API Method MAINTAIN_BAPI or MAINTAIN_DIRECT_INPUT
=> could you please provide the code for the same
It would be helpful for me if you provide the code for the same
Thanks,
Anoop
09-09-2014 8:21 AM
Regards,
Raymond
09-09-2014 12:12 PM
Hello Raymond Giuseppi,
Thanks for providing the above details.
* KRED_WRITE_DOCUMENT
=> I checked this FM and found that OBJECT ID is mandatory to create change log
But while updating LFBW ( using insert / update command on LFBWin Zprogram ) it doesnt create
any data in CDHDR ( didnt get any object id)
* VMD_EI_API Method MAINTAIN_BAPI
=> that is for creation / updation of vendor master. Here, I am looking for updation of withholding Tax-type in FK02 (Database Table - LFBW)
* RFBIKR00 Report
Checking the same.
Regards,
Anoop
09-09-2014 1:03 PM
So use standard tools (good) or fill yourself parameters of the FM (bad), it's up to you.
Regards,
Raymond
09-10-2014 7:45 AM
Hello Raymond,
Thanks a lot again.....
need to discuss more on your last past
(1). Change document wont come without coding, either SAP coding or yours, no hope..
(Direct insert/udpate SQL statements have no chance to trigger this FM...)
=> Even i do agree with this point. Standard calls Fm to update change document in badckground which is not in my Zprogram
(2). The method and LSMW report actually allow filling of LFBW, look better (thru LSMW there is an input structure BLFBW and I already posted the path to those data in the class method)
=> RFBIKR00 Report ---- stilll analysing
=> VMD_EI_API Method MAINTAIN_BAPI
Could you provide the sample code / e.g for the same....
Regards,
Anoop
09-10-2014 12:11 PM
You have to code using some loop into the deep structure of this parameter:
Class VMD_EI_API, method MAINTAIN_BAPI, parameter IS_MASTER_DATA type VMDS_EI_MAIN, component VENDORS, type VMDS_EI_EXTERN_T, table of VMDS_EI_EXTERN, component COMPANY_DATA, type VMDS_EI_VMD_COMPANY, component COMPANY, type VMDS_EI_COMPANY_T, table of VMDS_EI_COMPANY, component WTAX_TYPE, type VMDS_EI_WTAX_TYPE_S, structure VMDS_EI_WTAX_TYPE_S, component WTAX_TYPE, type VMDS_EI_WTAX_TYPE_T, table of VMDS_EI_WTAX_TYPE
How to navigate in deep structure: look at sample Creation of Vendor - VMD_EI_API. Some level of fill an internal table, move it to component of previous level defined as internal table, recursively.
Regards,
Raymond