Skip to Content
0
May 31, 2008 at 10:23 AM

Need to fetch sales order no. before creation

19 Views

Hi Experts,

My requirement is to add text in "Text" tab at item level in Sales Order creation. This is working fine for VA02 as I am using folowing code:

  • FM to store date in the 'Text' tab of the Sales Order

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

fid = 'Z0CF'

flanguage = gc_spras "Language

fname = gv_so_it "Sales Order No+Item number

fobject = gc_obj

save_direct = 'X'

fformat = '*'

TABLES

flines = it_temp "Data to populate text tab with

EXCEPTIONS

no_init = 1

no_save = 2

OTHERS = 3.

CLEAR it_date.

ENDLOOP. "it_date

It is working fine for VA02 as SO no. is existing and fname is getting sales order no and item no. to create text.

My problem is that I want to do same thing for transaction VA01. But the problem is fname doesn't get appropriate data as SO is still not created.

Is there any way I can achieve this?

Any structure or table that I can use?

Your help in this regard will be highly appreciated.

Best Regards,

Vishal Sharda.