Application Development and Automation 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: 
Read only

System Variable or Process code for Sales Order create/Change

former_member491305
Active Contributor
0 Likes
1,896

Hi All,

I have a wriiten custom routine (routine no 901) for Pricing in VOFM.Now the thing is the code is written in such a way that, the routine will be called only for transaction VA01 and VA02.But If i want the routine(901) to be executed also through BAPI_SALESORDER_CREATEFROMDAT2 and BAPI_SALESORDER_CHANGE ,then what system parameter i should check in my routine.

Currently the code is like this.

form frm_kondi_wert_901.

Check sy-tocde = 'VA01' or sy-tcode = 'VA02'.

*Process further'....

Endform.

I would appreciate for the valuable input....

Thanks,

Vigneswaran S

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,170

Use the strucutre T180.

IF T180-TCODE EQ 'VA01' OR T180-TCODE EQ 'VA02'.

This should solve your problem.

Regards

Sudhir Atluru

6 REPLIES 6
Read only

Former Member
0 Likes
1,171

Use the strucutre T180.

IF T180-TCODE EQ 'VA01' OR T180-TCODE EQ 'VA02'.

This should solve your problem.

Regards

Sudhir Atluru

Read only

0 Likes
1,170

Hi Sudhir,

Thanks for your reply.The strucure T180 does not exist in my routine RV64A901 .I am writing a routine in the include RV64A901 which has a main program SAPLV61A.Please help if there is any other parameter can be used?.

Thanks,

Vigneswaran S

Read only

0 Likes
1,170

Try getting the T180 table from memory.

Assign (SAPMV45A)T180 to a field symbol and access the data.

Regards

Sudhir Atluru

Read only

0 Likes
1,170

Hi,

Can you explain in detail?.Is there any FM to read the value from memory.

Regards,

Vigneswaran S

Read only

0 Likes
1,170

Write the following statements in your program.

FIELD-SYMBOLS: <fs> TYPE STANDARD TABLE.

DATA : l_t180(15) VALUE '(SAPMV45A)T180'.

DATA: it_t180 TYPE t180.

ASSIGN (l_180) TO <fs>.

it_t180 = <fs>.

IF it_t180-tcode EQ 'VA01' OR it_t180-tcode EQ 'VA02'

Regards

Sudhir Atluru

Read only

0 Likes
1,170

Awesome stuff sudhir..It is really a great logic to use..Thanks for ur help..

This is for future generation...

One Note:The field symbol should be declared as type any instead of "standard table".Because the T181 is used as global workarea(strucuture) in SAPMV45A program rather than internal table.

Here you go the modified code.

FIELD-SYMBOLS:<fs_t180> TYPE any .

DATA:wa_t180 TYPE t180,

c_t180(15) TYPE c VALUE '(SAPMV45A)T180'.

ASSIGN (c_t180) to <fs_t180>.

wa_t180 = <fs_t180>.

If wa_t180-tcode = 'VA01' or wa_t180-tcode = 'VA02'.

Endif.

Thanks,

Vigneswaran S