Hi ABAPers,
I have a problem when i want to print the invoice, every thing was fine but the address was not printing properly when it was in English. For all other languages it was printing properly.
I want to debugg the script for that. i activated the debugger and gone to VF02 , but that script was not triggering.
So can any one help me in this issue. I am pasting the code here.
********************************************************************
Print the delivery address (of the ship-to)
when the sold-to is NOT equal to the ship to (zdel = 1) OR
the sold-to has a PO box
(zdel = 1 when at least one of the following is different:
name1 or name2 or street)
********************************************************************
When the sold-to and the ship-to are the same (customer nbr) and
the address has not been changed in the address fields in the
billing document, the address fields of the ship to in the
structure are empty. In that case we take the values in the
fields of the sold-to.
First check ZZ80 text
DEFINE &TTYPE1& = 'ZZ80'
DEFINE &EXISTS& = 'N'
PERFORM CHECK_TEXTS_SINGLE IN PROGRAM ZVPPU003
USING &TTYPE1&
USING &VBDKR-VBELN&
USING &NAST-SPRAS&
CHANGING &EXISTS&
ENDPERFORM
IF &EXISTS& = 'Y' . par < B > Delivery address < / >
INCLUDE &VBDKR-VBELN(K)& OBJECT VBBK IDZZ80 LANGUAGE &HZZ80&
ELSE
IF &VBDKR-LAND1_WE& NE &SPACE& .
check whether the sold-to is the same as the ship to
This check is based on the 'name1', 'name2', 'name4 or 'stras' of
both partners
DEFINE &ZDEL&:= '0'
DEFINE &ZCTRY& := &SPACE&
PERFORM Z_DELIVERY_CHECK_2 IN PROGRAM ZVPPU002
USING &VBDKR-NAME2&
USING &VBDKR-NAME2_WE&
USING &VBDKR-NAME1&
USING &VBDKR-NAME1_WE&
USING &VBDKR-STRAS&
USING &VBDKR-STRAS_WE&
USING &VBDKR-NAME4&
USING &VBDKR-NAME4_WE&
USING &VBDKR-VBELN&
CHANGING &ZDEL&
CHANGING &ZCTRY&
ENDPERFORM
Always print delivery address *** IHO 2005.11.30
DEFINE &ZDEL&:= '1'
when sold-to = ship-to or the sold-to has a po box
IF &ZDEL& = '1' OR &VBDKR-PFACH& <> &SPACE&
Get the country vehicle number and the country code
in the correct language
DEFINE &LANDD& := &SPACE&
DEFINE &LAND11& := &SPACE&
PERFORM READ_LAND IN PROGRAM ZVPPU003
USING &VBDKR-LAND1_WE&
USING &NAST-SPRAS&
CHANGING &LANDD&
CHANGING &LAND11&
ENDPERFORM
Print the address
parDelivery address</>
par&VBDKR-NAME1_WE&&VBDKR-ANRED_WE&par&VBDKR-NAME2_WE&
&VBDKR-NAME3_WE&
&VBDKR-STRAS_WE&
&street2_we&
&VBDKR-NAME4_WE&
When the postal code is empty, only the city name is printed
IF &VBDKR-PSTLZ_WE& = &SPACE&
&VBDKR-ort01_WE&
ELSE
&LAND11&-&VBDKR-PSTLZ_WE& &VBDKR-ort01_WE&
&vbdkr-pstlz_we& &vbdkr-ort01_we&
ENDIF
&LANDD&
&GV_LANDX_SH&
ENDIF
IF &ZDEL& = '2' .
Delivery address
&VBDKr-NAME1_WE&&VBDKr-ANRED_WE&
&VBDKr-NAME2_WE&
&VBDKR-NAME3_WE&
&VBDKr-STRAS_WE&
&street2_we&
&VBDKr-NAME4_WE&
When the postal code is empty, only the city name is printed
IF &VBDKR-PSTLZ_WE& = &SPACE&
&VBDKr-ort01_WE&
ELSE
&VBDKr-PSTLZ_WE& &VBDKr-ort01_WE&
ENDIF
&zctry&
ENDIF
This is the else part of the logic that was included for when
the customer numbers are the same and the address has not been
changed
ELSE
***When the sold to and the ship to are the same and the address info
***is the same, then the delivery address is printed when the sold to
***has a po box and the ship to has a street
IF &VBDKR-PFACH& <> &SPACE& AND &VBDKR-STRAS& <> &SPACE&
DEFINE &LANDD& := &SPACE&
DEFINE &LAND11& := &SPACE&
PERFORM READ_LAND IN PROGRAM ZVPPU003
USING &VBDKR-LAND1&
USING &NAST-SPRAS&
CHANGING &LANDD&
CHANGING &LAND11&
ENDPERFORM
Delivery address
&VBDKR-NAME1&&VBDKR-ANRED&
&VBDKR-NAME2&
&VBDKR-NAME3&
&VBDKR-STRAS&
&street2_we&
&VBDKR-NAME4&
IF &VBDKR-PSTLZ& = &SPACE&
&VBDKR-ort01&
ELSE
&LAND11&-&VBDKR-PSTLZ& &VBDKR-ort01&
&VBDKR-PSTLZ& &VBDKR-ort01&
ENDIF
&gv_LANDx_sh&
ENDIF
ENDIF
ENDIF
Thanks & Regards,
Ramana Prasad.