Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Data declaration in implicit enhancement in va01

former_member1716
Active Contributor
0 Kudos

Hello experts,

Am declaring the following data declaration in include MV45AFZZ under form userexit_save_document.

data : gt_xvbak type standard table of xvbak,
      wa_xvbak type xvbak.
But am getting an error as Xvbak is unknown.
I need create an internal table and work area from this structure xvbak.
Please help me resolving this issue.

14 REPLIES 14

venkateswaran_k
Active Contributor
0 Kudos

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

0 Kudos

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.

0 Kudos

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

0 Kudos

Hi Venkat,

Will surely Try this and let you know,

Thanks for your Reply.

0 Kudos

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.

0 Kudos

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.

himanshu_gupta13
Employee
Employee
0 Kudos

Dear Satish,

you can declare it through like it_xvbak like table of xvbak.

and wa_xvbak like xvbak.

Many Thanks / Himanshu Gupta

0 Kudos

Hi Gupta,

I tried that but in this its syntatically correct, But the table is not getting populated.

0 Kudos

Dear Satish,

I tried on my side, its working and it's also getting populated.

I think you should try as Mr.

0 Kudos

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

0 Kudos

IT IS XVBAK_UPDKZ ,

If i remove the else part the control goes inside else control is coming o else part.

0 Kudos

can you debug it the value ?

show me the screen shot

0 Kudos

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.



haresh_manani
Explorer
0 Kudos

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.