cancel
Showing results for 
Search instead for 
Did you mean: 

Standard Script Modification

Former Member
0 Kudos

Hi,

I am new to SAP Scripts.

My Requirement is i need to insert Company name based on Plant Code.

The thing is how come i validate the company code, because the table which is used in the script has got only plant, but if i want to use that i need to hard code all plant codes.

Can any one tell me how to do it in other way, like defining the range in program and how to export that from program to script?

Waiting for ur Reply...

-


Regards,

Srinath

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Srinath

In script need to code like this:

/: PERFORM GET_COMPNAME IN PROGRAM Z_TEST

/: USING &PLANT_CODE& "let say this plant code in your script

/: CHANGING &V_CMPCODE&

/: ENDPERFORM.

After this you can use the value &V_CMPNAME& in that window like :

P1 &V_CMPNAME&

In program Z_TEST code like this :

FORM get_compcode TABLES input_tab STRUCTURE itcsy

output_tab STRUCTURE itcsy.

DATA: V_CMPNAME(45).

READ TABLE input_tab WITH KEY name = 'PLANT_CODE'.

IF sy-subrc = 0.

lv_werks = input_tab-value.

select company name....

READ TABLE output_tab WITH KEY name = 'V_CMPNAME'.

IF SY-SUBRC = 0.

output_tab-value = V_CMPNAME.

MODIFY output_tab TRANSPORTING value

WHERE name = 'V_CMPNAME'.

ENDIF.

ENDFORM.

This could solve your problem.

Regards,

Suneel G.