on 05-26-2010 8:07 AM
Hello sir ,
I want to get adress of compnies dynamically based on the company code.
If we have only company code we can write in adress window .
but here if 3 companies how we ll get 3 different adress based on the company code in script ??
where we have to write the program? should we have to create new program? r else can continue with ?
Please let me know the procedure ... step by step
Thankyou
Regards
Reddy
Hi,
Use subroutine to get the ADDRESSNUMBER of the company code in your script.
Like this:
PERFORM GET_ADDRESS USING <company_code> CHANGING <address_no> IN PROGRAM <driver program>
ENDPERFORM
Define the subroutine GET_ADDRESS in your driver program.
Fetch the ADDRESSNO(ADRNR) from table T001 by providing the COMPANY CODE.
Then use the <address_no> to print the address of the company.
Regards
Dillip Sahoo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thankyou....
actually in my selection screen there filed called Excise group ...if we give exicse group as 52 it should call the one company code . and if give other it should call the other ...
Please let me step by step wt have to be done .
THis is standard sap script .. i just copied and made changes to my requirement . i didnt changed the driver program.
Please tell where should i write the subrountine as well as in script .
Thankyou,
Regards
Hi,
No need to change the standard driver program.
First you create a Subroutine Pool program by choosing the type of the program as Subroutine Pool instead of Executable Program. Suppose the name of the program is Z_FORMS_EXIT.
/: PERFORM GET_ADDRESS IN PROGRAM Z_FORMS_EXIT
/: USING <excise_group>
/: CHANGING <address_no>
/: ENDPERFORM
Then put the logic in subroutine GET_ADDRESS of your Subroutine Pool program Z_FORMS_EXIT.
You know the company code based on the Excise group.
Fetch the ADDRESSNO(ADRNR) from table T001 by providing the COMPANY CODE and pass it to the variable <address_no>.
/: ADDRESS PARAGRAPH AS
/: ADDRESSNUMBER &<address_no>(K)&
/: ENDADDRESS
For more details
[Calling ABAP Subroutines: PERFORM |http://help.sap.com/erp2005_ehp_04/helpdata/EN/d1/803279454211d189710000e8322d00/frameset.htm]
Regards
Dillip Sahoo
hi,
You can use PERFORM.. END PERFORM in script to get the address based n company code. To fetch the address you need to put your logic in driver program.
PERFORM GET_address IN PROGRAM ' Ur driver program'
Using...
changing....
ENDPREFORM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.