10-24-2013 8:04 AM
Hello experts,
Am declaring the following data declaration in include MV45AFZZ under form userexit_save_document.
10-24-2013 8:13 AM
Hi Satish,
Create declaraton as follows:
DATA: BEGIN OF t_xvbak.
INCLUDE STRUCTURE vbak.
DATA: agupda LIKE rv02p-agupd,
weupda LIKE rv02p-weupd,
auartupda,
END OF t_xvbak.
data : gt_xvbak type table of t_xvbak,
wa_xvbak type t_xvbak.
Regards,
Venkat
10-24-2013 9:54 AM
Hi Venkat,
Now it is showing the same error for t_xvbak.
Actually i need to fetch value form xvbak itself, because it is the table that holds value in runrime.
10-24-2013 10:00 AM
Dear Satish,
You can access it in VBAK itself. You do not need xvbak unless you require the variables agupda, weupda.
So instead of xvbak use directly vbak. I am using it in same way in one of my requirement.
If you still want to use xvbak, then put your codes under this form...
USEREXIT_SAVE_DOCUMENT_PREPARE instead of userexit_save_document
10-24-2013 10:29 AM
Hi Venkat,
Will surely Try this and let you know,
Thanks for your Reply.
10-24-2013 11:10 AM
hi venkat,
I think it is working, But now i have one statement as below in my coding,
if XVBAK_UPDKZ eq 'U' or XVBAK_UPDKZ eq 'I'.
now this condition is validating as false, But i have the value of XVBAK_UPDKZ as U only.
Please help me on this.
10-24-2013 12:11 PM
Hi Venkat and all,
Below is my code,Here after the highlighted line control is directly going to else Part, Is anything wrong with this code??? Please Help me.
My requirement is whenever i make change through va42 it must be update the data to the PI interface
data : wa_xvbak like xvbak,
gt_xvbak like wa_xvbak occurs 5.
DATA : wa_veda like *veda_k,
gt_veda like standard table of wa_veda.
DATA : wa_xvbap like xvbap,
gt_xvbap like standard table of wa_xvbap.
DATA: gt_header TYPE TABLE OF zcontract_header,
wa_header TYPE zcontract_header.
DATA: gt_item TYPE TABLE OF zcontract_item,
wa_item TYPE zcontract_item.
if XVBAK_UPDKZ eq 'U' . " After this line control is going to else part below.
if sy-subrc eq 0.
wa_xvbak-vbeln = xvbak-vbeln.
append wa_xvbak to gt_xvbak.
clear wa_header.
wa_header-vbeln = wa_xvbak-vbeln.
wa_header-ktext = wa_xvbak-ktext.
wa_header-vkorg = wa_xvbak-vkorg.
wa_header-vtweg = wa_xvbak-vtweg.
wa_header-spart = wa_xvbak-spart.
wa_header-kunnr = wa_xvbak-kunnr.
* endif.
clear wa_veda.
read table gt_veda into wa_veda with key *veda_k-vbeln.
if sy-subrc eq 0.
wa_header-vuntdat = wa_veda-vuntdat.
wa_header-vbegdat = wa_veda-vbegdat.
wa_header-venddat = wa_veda-venddat.
wa_header-vasda = wa_veda-vasda.
wa_item-vbegdat = wa_veda-vbegdat.
wa_item-venddat = wa_veda-venddat.
endif.
clear wa_xvbap.
read table gt_xvbap into wa_xvbap with key xvbap-vbeln.
if sy-subrc eq 0.
clear wa_item.
wa_item-posnr = wa_xvbap-posnr.
wa_item-matnr = wa_xvbap-matnr.
wa_item-arktx = wa_xvbap-arktx.
wa_item-werks = wa_xvbap-werks.
wa_item-vstel = wa_xvbap-vstel.
endif.
append wa_header to gt_header.
append wa_item to gt_item.
else.
write 'abcd'.
endif.
if sy-subrc eq 0.
clear wa_xvbak.
read table gt_xvbak into wa_xvbak with key xvbak-vbeln.
10-24-2013 10:24 AM
Dear Satish,
you can declare it through like it_xvbak like table of xvbak.
and wa_xvbak like xvbak.
Many Thanks / Himanshu Gupta
10-24-2013 10:28 AM
Hi Gupta,
I tried that but in this its syntatically correct, But the table is not getting populated.
10-24-2013 11:03 AM
Dear Satish,
I tried on my side, its working and it's also getting populated.
I think you should try as Mr. Venkateswaran K second form.
Many Thanks/ Himanshu Gupta
10-24-2013 1:25 PM
Hi Satish,
Can you set the break point and see the value?
Also,
I am worried is your variable is XVBAK_UPDKZ or XVBAK-UPDKZ
ie. underscore or hyphen ?
Regards,
Venkat
10-24-2013 1:44 PM
IT IS XVBAK_UPDKZ ,
If i remove the else part the control goes inside else control is coming o else part.
10-24-2013 1:51 PM
10-24-2013 11:10 AM
Hi Satish,
You can directly use vbak in place of xvbak
data : gt_xvbak type standard table of vbak,
wa_xvbak type vbak.
and move ur data
gt_xvbak[] = xvbak[].
or
wa_xvbak = xvbak.
as i did with vbap in form userexit_save_document_prepare.
data : lwa_vbap type vbap.
read table xvbap into lwa_vbap index 1.
I feel it will surely work as per Venkat also suggests.
10-29-2013 7:22 AM
Hi Satish,
Use LIKE instead of TYPE as below :-
DATA : gt_xvbak LIKE STANDARD TABLE OF xvbak,
wa_xvbak LIKE xvbak.
XVBAK is already an internal table , hence you cannot use TYPE.
Thanks & Regards,
Haresh Manani.