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: 

I lose field values when I enter in a perform

Former Member
0 Kudos

Daer all,

My problem is simple but I don't find the solution :

I wrote a specific program with PBO-PAI.

I used a BAPI or function module to create or change sales orders.

For change, I use FM SD_SALESDOCUMENT_CHANGE. The field "salesdocument" is correctly filled in.

In the standard code, we have :

VBAK-VBELN = DOCUMENT_NUMBER.

PERFORM BELEG_LESEN(SAPMV45A).

document_number is filled in before enter in perform.

In the perform the vbak-vbeln is empty and so the FM gives me an error message to say that "fill in the document number"

Could you help me ?

thanks

kind regards

véronique

Edited by: Matt on Feb 16, 2009 4:28 PM - subject edited

12 REPLIES 12

Former Member
0 Kudos

paas the value to a global variable.of type VBAK-VBELN ..and use it in the form ...

in perfrom you can use using also

perform f_perform using global variable

Former Member
0 Kudos

Hi,

I guess that you have your Z-programme and you try to call within it SAP´s subroutine BELEG_LESEN in programme SAPMV45A. The problem is that there´s no communication between your programme and the standard subroutine and that´s why you lose the values in VBAK-VBELN.

You could transfer the value in VBAK-VBELN if you use PERFORM BELEG_LESEN(SAPMV45A) using VBAK-VBELN but the problem is that you must modify a SAP object and all calling performs.

Why don´t you use function SD_SALES_DOCUMENT_READ, which calls that subroutine ?? You have in the interface DOCUMENT_NUMBER as import parameter.

0 Kudos

Thanks for your quick answer.

I think there is a problem with my specific program because when I use the BAPI (create_from_dat2 ) or directly the FM (SD_sales_document_create or change), in a simple program with SE38 in direct use, it works properly.

If I use it in my other program in the PAI, it doesn't work.

I can't change the standard program.

My colleague uses the BAPI for creation in the same way than me (in a PAI module), and it works.

I don't understand what happens for me.

I though it was a problem with Unicode but not.

thanks

0 Kudos

So

U mean u're calling the fm SD_sales_document_change in PAI module?

How are u calling it?

Max

0 Kudos

Yes, that'it.

I called the FM as I called it in SE38.

I found a solution but I would like to understand what happened :

I filled in the structure in my PAI module and export it in memory.

I did a submit of an external program (import the structure in it) and it works.

And it is very strange because it works for my colleague.

Thanks

Kind regards

Véronique

0 Kudos

Hi

It's not easy to understand why without to see your program: it should be any different beetween a report and module pool, in this situation they should have the same behavior.

Max

0 Kudos

Hi Veronique,

what about consult it with your colleague? Simply ask him with showing your code to him. It seems (s)he knows the solution. Or show us your PAI/PBO module, somebody will check it.

Regards,

Pavel

0 Kudos

Hi Jorge,

I am facing the same problem. Do you have any solution for this.

I am actually using the BAPI_SALESORDER_CHANGE. Inside this FM, SD_SALESDOCUMENT_CHANGE FM is being called/

I am facing a problem where the VBAK-VBELN values gets vanishes no sooner I enter into the Subrouting BELEG_LESEN(SAPMV45A).

Please help me.

0 Kudos

Submitted by Babu Kilari in another thread

myself found the solution for this problem.

At the starting point of the Subroutine BELEG_LESEN, I had created implicit enhancement point to write the below piece of code.

FIELD-SYMBOLS: <fs_testvbak> TYPE vbak.

IF vbak-vbeln IS INITIAL.

ASSIGN ('(SAPLV45A)VBAK') to <fs_testvbak>.

IF sy-subrc EQ 0

AND <fs_testvbak> IS ASSIGNED.

MOVE <fs_testvbak>-vbeln to vbak-vbeln.

ENDIF.

ENDIF.

The reason why I had to write the above piece of code :-

SAPLV45A & SAPMV45A are two different programs. Both of them have VBAK as structure.

In our case, in the below piece of code, DOCUMENT_NUMBER which has got the Sales Order number has been assigned to VBAK-VBELN which is part of the SAPLV45A program.

The next subroutine clearly tells us that it is an external form which is being called from the program SAPMV45A.

As the VBAK structure of SAPMV45A is initialized, once the control gets into the subroutine BELEG_LESEN, it refers to the new structure VBAK which is empty.

So, our code that has been implemented as part of implicit enhancement will ensure that the right data is being passed to proceed further

0 Kudos

Hi Babu,

I am facing the same problem you had. Could you finally solve this issue? If so, I would be very grateful if you could just post me the solution. I am desesperated! Thanking you in advance,

Nisha

Former Member
0 Kudos

Hi

In the standard where?

I've tried this code:

REPORT ZTEST.
TABLES VBAK.

VBAK-VBELN = '0000000001'.
PERFORM BELEG_LESEN(SAPMV45A).

and it works fine: i.e. the value 0000000001 is correctly transfered to the routine BELEG_LESEN.

Max

0 Kudos

There is a an OSS note available for this one...

Note 393728 - SD sales document cannot be read

You can try to implement that. Though of sharing it, though it is late.