on 02-06-2009 1:30 AM
Hello All,
I am trying to print additional lines of street address (i.e. Street4 and Street5) in the sales order confirmation SAPScript form (BA00) output. I see that the structure VBDKA is being used to display the Ship-to-party address details. However, it does not have the additional street fields in it.
How can I print these additional street lines?
Any help will be greatly appreciated.
Thanks,
Rugmani
If you are entering the street4 and street5 information in your address then just reference
ADDRESSNUMBER
The number is used to index a central address file, from which the desired address is read instead of using the set of the above fields. You can find more information on this facility in the documentation for the function module ADDRESS_INTO_PRINTFORM.
You use this one parameter instead of the set of parameters described before.
So instead of:
/: ADDRESS
/: TITLE 'Firma'
/: NAME 'Schneider & Co', 'Finanzberatung'
/: STREET 'Kapitalgasse 33'
/: POBOX '12345' CODE '68499'
/: POSTCODE '68309'
/: CITY 'Mannheim'
/: COUNTRY 'DE'
/: FROMCOUNTRY 'DE'
/: ENDADDRESS
Just use:
/: ADDRESS
/: ADDRESSNUMBER
/: ENDADDRESS
This should display the address the way it is entered.
Hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the INFO1 page of the SAPScript form I inserted the following code:
/: IF &VBDKA-LAND1_WE& NE &SPACE&.
/* * Ship-To Address (not identical to Sold-To)
/: ADDRESS DELIVERY PARAGRAPH AS
/: ADDRESSNUMBER &VBDKA-ADRNR&
/: ENDADDRESS
/: ELSE.
/* * Output Partner (Sold-To)
/: ADDRESS PARAGRAPH AS
/: TITLE &VBDKA-ANRED&
/: NAME &VBDKA-NAME1&, &VBDKA-NAME2&, &VBDKA-NAME3&, &VBDKA-NAME4&
/: STREET &VBDKA-STRAS&
/: POBOX &VBDKA-PFACH& CODE &VBDKA-PSTL2&
/: CITY &VBDKA-ORT01&, &VBDKA-ORT02&
/: POSTCODE &VBDKA-PSTLZ&
/: COUNTRY &VBDKA-LAND1&
/: REGION &VBDKA-REGIO&
/: FROMCOUNTRY &VBDKA-SLAND&
/: ENDADDRESS
/: ENDIF.
However, I do not see the additional street lines filled in the form output.
Is there something wrong with my code? I think VBDKA structure does not accomodate the additional street lines. Is there any other structure that I can use? Do I have to change anything in the print program?
Thanks,
Rugmani
Added these lines in print program:
FORM get_ship_to_addr .
DATA: f_vbpa LIKE vbpa.
CLEAR f_vbpa.
SELECT SINGLE * FROM vbpa INTO f_vbpa
WHERE vbeln = vbdka-vbeln
AND parvw = 'WE'. "BP: Ship-To party
IF sy-subrc = 0.
CALL FUNCTION 'VIEW_VBADR'
EXPORTING
input = f_vbpa
IMPORTING
adresse = g_ship_to_addr
EXCEPTIONS
OTHERS = 1.
ENDIF.
IF sy-subrc <> 0.
ENDIF.
To get additional Ship-to-address lines
SELECT SINGLE str_suppl3 location FROM adrc
INTO (g_ship_to_addr-strs2, g_ship_to_addr-pfort)
WHERE addrnumber = g_ship_to_addr-adrnr.
ENDFORM. "GET_SHIP_TO_ADDR
And used the G_SHIP_TO_ADDR structure in the SAPscript.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Try retrieving the address number from TWLAD table
Send Plant (WERKS), Storage location (LGORT) and retrieve the address number (ADRNR) from the table TWLAD)
use this adress number between
/:address
addressnumber.
/:endaddress
Hope this is helpful.
Thanks
Sharath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rugmani Rajan ,
In script need to code like this:
/: PERFORM GET_ADDRESS IN PROGRAM Z_TEST
/: USING &VBDKA-ADRNR&
/: CHANGING &STREET_4&
/: CHANGING &STREET_5&
/: ENDPERFORM.
After this you can use the values &STREET_4&, &STREET_5& in that window
In program Z_TEST code like this :
FORM get_address TABLES input_tab STRUCTURE itcsy
output_tab STRUCTURE itcsy.
DATA: street_4 LIKE adrc-str_suppl1,
street_5 LIKE adrc-str_suppl2,
lv_adrnr like adrc-adrnr.
READ TABLE input_tab WITH KEY name = 'VBDKA-ADRNR'.
IF sy-subrc = 0.
lv_adrnr = input_tab-value.
SELECT SINGLE str_suppl4 str_suppl5
FROM adrc
INTO (STREET_4 , STREET_5) WHERE addrnumber = lv_adrnr.
READ TABLE output_tab WITH KEY name = 'STREET_4'.
IF SY-SUBRC = 0.
output_tab-value = STREET_4.
MODIFY output_tab TRANSPORTING value
WHERE name = ''STREET_4'.
ENDIF.
READ TABLE output_tab WITH KEY name = 'STREET_5'.
IF SY-SUBRC = 0.
output_tab-value = STREET_5.
MODIFY output_tab TRANSPORTING value
WHERE name = ''STREET_5'.
ENDIF.
ENDFORM.
This could solve your problem.
Regards,
sg.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this will give u the whole address.
/: address
/: &addrnumber&
/: endaddress
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.