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

Sap oss note

Former Member
0 Likes
1,684

Hi Experts,

Please see the following requirement and let me give the sujjestion for it,It will be very helpfull to me.Thanks in advance.

SAP Note No. 851943 04.07.2005 Page 1

________________________________________________________________________

Number 851943

Version 3 from 27.06.2005

Status Released for Customer

Set on 27.06.2005

Language EN Caution: Translation Not Current!

Master language DE

Short text Separate country codes for Serbia, Montenegro and

Kosovo

Responsible SAP AG

Component SD-FT-GOV

Declarations to Authorities Export

________________________________________________________________________

Long text

Symptom

As a result of EU regulation 750/2005 of May 18, 2005, the 'CS' country

code (094) for Serbia and Montenegro in the area of foreign trade

statistics is to be replaced with the following new country codes as of

June 01, 2005:

o XK (095) Kosovo

o XM (097) Montenegro

o XS (098) Serbia

Other terms

Intrastat, Extrastat, country of origin, Serbia, Montenegro, Kosovo,

country code, ENPA, VE01, MEIS, country of departure, URSPRSLND,

URSPRSLND, HERKL, URZLA, BESTILAND, country of destination, country of

dispatch

Reason and Prerequisites

This is a legal change.

Solution

As the country key is checked against the country table (T005) in

several parts of the program, it is necessary to add three new country

codes ( XK, XM and XS) to this table even though these country codes do

not form part of the ISO 3166 nomenclature (link:

http://www.iso.org/iso/en/prod

s-services/iso3166ma/02iso-3166-code-lists/index.html).

To enter the new country codes, proceed as follows:

Customizing --> General Settings --> Set Countries --> Define Countries

in R/3 Systems --> New Entries

At present, the three new country codes are only relevant for the area

of foreign trade statistics. Therefore, a basic definition is

sufficient.

Specify the following information:

o Country XK

Alternative key: 094

Page 2

Name: Kosovo

ISO code: XK

o Country XM

Alternative key: 097

Name: Montenegro

ISO code: XM

o Country XS

Alternative key: 098

Name: Serbia

ISO code: XS

Caution

The unfavorable effect of adding these new country codes to the country

table is that they are available throughout the SAP system and can be

selected for all country specifications. For example, you can now set

the country of a customer or vendor to one of these new values, but this

is certainly never desired.

For this reason and because these new country codes are only required by

a relatively small number of SAP customers, the new country codes XK, XM

and XS are not delivered as SAP standard Customizing, but rather, each

customer must add these to the table if they require them.

Each customer must take the necessary steps to ensure that these country

codes are not "misused" (as described in the above example).

As a standard country code is no longer available for Serbia and

Montenegro (the country codes are XK/XM/XS for foreign trade statistics

and CS for other applications), this new requirement must be met using

the user exits that are available. To avoid conflicts between the

applications, we advise against changing the country code in the master

data.

Approaches:

- Intrastat

Since Serbia and Montenegro does not form part of the European

Union, the changes to the country code only affect the

specification of the country of origin.

If the volume of data is low, you can change the country code

for the country of origin from 'CS' to 'XK', 'XM' or 'XS'

either directly in the documents (billing documents and

purchase orders) before selecting the Intrastat data, or using

Transaction VEFU after selecting the data.

Page 3

In theory, the EXIT_SAPLV50E_003 and EXIT_SAPLV50E_004 user

exits (change foreign trade item data in the SD and MM

documents), the EXIT_SAPLV50G_001 user exit (change the

document data before processing in the selection program) and

the EXIT_SAPLV50G_002 user exit (change the Intrastat data

after processing in the selection program) are suitable for

automatic implementation of these data changes.

The correction instructions contain example code for a

possible solution using the EXIT_SAPLV50G_002 user exit

(section entitled "INTRASTAT"). This user exit is processed at

the end of the data selection program, shortly before the

Intrastat data is written to the VEIAV file.

- Extrastat

This affects the specification of the country of destination

(export declaration), the country of dispatch (import

declaration) and the country of origin (import declaration and

export declaration).

If the volume of data is low, you can change the country code

either directly in the documents before selecting the

Extrastat data (country of dispatch and country of origin in

the foreign trade data for billing documents and purchase

orders), or using Transaction VEXU after selecting the data.

In theory, the EXIT_SAPLV50E_003 and EXIT_SAPLV50E_004 user

exits (change foreign trade item data in the SD and MM

documents), the EXIT_SAPLV50G_001 user exit (change the

document data before processing in the selection program) and

the EXIT_SAPLV50G_002 user exit (change the Extrastat data

after processing in the selection program) are suitable for

automatic implementation of these data changes.

The correction instructions contain example code for a

possible solution using the EXIT_SAPLV50G_002 user exit

(section entitled "EXTRASTAT"). This user exit is processed at

the end of the data selection program, shortly before the

Extrastat data is written to the VEXAV file.

Of course, the source code contained in the correction instructions is

merely example source code. Insert your values in those places marked

with arrow ( <-- ).

Of course, other conditions may also require you to set the new country

codes; the EXIT_SAPLV50G_002 user exit has header data and item data for

the billing documents and purchase orders as well as their foreign trade

data.

Comments:

Background:

By default, the country of origin for both the Intrastat declaration and

Page 4

the Extrastat declaration are determined as follows:

o Receipt/import

The information for the country of origin is copied from the

purchasing info record of the vendor (EINA-URZLA field); if the

field is not set, the country of origin is set from the material

master record (MARC-HERKL field).

o Dispatch/export

The information for the country of origin (and the region of

origin) is copied from the material master record or the batch

master record.

By default, the country of destination is set in the Extrastat

declaration for exports from the "Destination Country" field in the

billing header (VBRK-LAND1).

By default, the country of dispatch is set in the Extrastat declaration

for imports from the "Country of dispatch" field for the export data of

the billing item (EIPO-VERLD). If this is not filled, the country of the

supplying vendor or the country of the vendor is set.

It is therefore quite possible that the country of dispatch is not set

in the foreign trade data for the document item (EIPO-VERLD). In this

case, you would have to change the command line from:

IF i_direction EQ '1' AND "import

c_record_extrastat-versendld EQ 'CS'. "Serbia/Montenegro

...

to:

IF i_direction EQ '1' AND "import

c_record_extrastat-versendld IS INITIAL. "initial

...

After this change, only the vendor number (and other fields, if

required) determines whether you have to set the country code.

Releases 4.0B and 3.1I

In these releases, the use of user exits when selecting data is

extremely limited. We recommend that you use the user exits that are

processed to determine the foreign trade data for billing items

(EXIT_SAPLV50E_003) and purchase order items (EXIT_SAPLV50E_004), in

order to already set the required country code in the documents.

Otherwise, in these releases you can also use Transactions VEFU and VEXU

to manually maintain Intrastat data.

________________________________________________________________________

Page 5

Valid releases

Software Component Release

from to

SAP_APPL SAP Application

500 - 500

470 - 470

46C - 46C

46B - 46B

45B - 45B

40B - 40B

31I - 31I

Further components

MM-FT-GOV

Declarations to Authorities Import

________________________________________________________________________

Reference to related Notes

Number Short text

____________________________________________________________

603152 Country Code for "Serbia and Montenegro"

________________________________________________________________________

Page 6

Assigned Correction Instructions

________________________________________________________________________

$$----


$$

$ Correction Inst. 0120061532 0000735967 $

$----


$

$ Valid for : $

$ Software Component SAP_APPL SAP Application $

$ Release 45B All Support Package Levels $

$ Release 46B All Support Package Levels $

$ Release 46C All Support Package Levels $

$ Release 470 All Support Package Levels $

$ Release 500 All Support Package Levels $

$----


$

$ Changes/Objects Not Contained in Standard SAP System $

$$----


$$

&----


*& Object REPS ZX50GU02

*& Object Header PROG ZX50GU02

&----


*>>>> START OF INSERTION <<<<

***********

  • INTRASTAT

***********

IF i_reporting_type EQ 'I'.

*----


  • change COUNTRY OF ORIGIN

*----


IF c_record_intrastat-ursprslnd EQ 'CS'. "Serbia/Montenegro

  • arrival

IF i_direction EQ '1'.

DATA: z_lifnr LIKE ekko-lifnr.

IF i_mm_purch_order_header-llief IS INITIAL.

z_lifnr = i_mm_purch_order_header-lifnr.

ELSE.

z_lifnr = i_mm_purch_order_header-llief.

ENDIF.

  • set country depending on vendor

IF z_lifnr EQ 'XS4711'. "<-- vendor

c_record_intrastat-ursprslnd = 'XS'. "<-- new country code

ENDIF.

IF z_lifnr EQ 'XK4712'. "<-- vendor

c_record_intrastat-ursprslnd = 'XK'. "<-- new country code

ENDIF.

*...

  • set country depending on vendor and material

IF z_lifnr EQ 'CS4713'. "<-- vendor

IF i_mm_purch_order_line_item-matnr EQ 'mat55'. "<-- mat.no.

c_record_intrastat-ursprslnd = 'XM'. "<-- new country code

ENDIF.

IF i_mm_purch_order_line_item-matnr EQ 'mat71'. "<-- mat.no.

c_record_intrastat-ursprslnd = 'XS'. "<-- new country code

Page 7

ENDIF.

ENDIF.

  • ....

  • dispatch

ELSEIF i_direction EQ '2'.

  • set country depending on material and plant

IF ( i_sd_invoice_line_item-matnr EQ 'mat_from_serbia' "<-- mat.no.

AND i_sd_invoice_line_item-werks EQ 'CS01' ). "<-- plant

c_record_intrastat-ursprslnd = 'XS'. "<-- new country code

ENDIF.

IF ( i_sd_invoice_line_item-matnr EQ 'mat_from_kosovo' "<-- mat.no.

AND i_sd_invoice_line_item-werks EQ 'CS12' ). "<-- plant

c_record_intrastat-ursprslnd = 'XK'. "<-- new country code

ENDIF.

IF ( i_sd_invoice_line_item-matnr EQ 'mat_from_montenegro' "<-- mat.

AND i_sd_invoice_line_item-werks EQ 'CS99' ). "<-- plant

c_record_intrastat-ursprslnd = 'XM'. "<-- new country code

ENDIF.

  • ...

ENDIF.

ENDIF.

ENDIF.

***********

  • EXTRASTAT

***********

IF i_reporting_type EQ 'E'.

*----


  • change COUNTRY OF ORIGIN

*----


IF c_record_extrastat-ursprslnd EQ 'CS'. "Serbia/Montenegro

*...

*... see INTRASTAT !

*... !!! just replace 'c_record_intrastat-ursprslnd' by

*... 'c_record_extrastat-ursprslnd' !!!

*...

ENDIF.

*----


  • change COUNTRY OF DISPATCH

*----


IF i_direction EQ '1' AND "import

c_record_extrastat-versendld EQ 'CS'. "Serbia/Montenegro

DATA: zz_lifnr LIKE ekko-lifnr.

IF i_mm_purch_order_header-llief IS INITIAL.

zz_lifnr = i_mm_purch_order_header-lifnr.

ELSE.

zz_lifnr = i_mm_purch_order_header-llief.

ENDIF.

  • set country depending on vendor

Page 8

IF zz_lifnr EQ 'XS4711'. "<-- vendor

c_record_extrastat-versendld = 'XS'. "<-- new country code

ENDIF.

IF zz_lifnr EQ 'XK4712'. "<-- vendor

c_record_extrastat-versendld = 'XK'. "<-- new country code

ENDIF.

*...

ENDIF.

*----


  • change COUNTRY OF DESTINATION

*----


IF i_direction EQ '2' AND "export

c_record_extrastat-bestiland EQ 'CS'. "Serbia/Montenegro

  • set country depending on sold-to-party

IF i_sd_invoice_header-kunag EQ 'monte01'. "<-- sold-to-party

c_record_extrastat-bestiland = 'XM'. "<-- new country code

ENDIF.

  • set country depending on payer

IF i_sd_invoice_header-kunrg EQ 'Kos05'. "<-- payer

c_record_extrastat-bestiland = 'XK'. "<-- new country code

ENDIF.

  • set country depending on material

IF i_sd_invoice_line_item-matnr EQ 'mat_to_serbia'. "<-- mat.no.

c_record_extrastat-bestiland = 'XS'. "<-- new country code

ENDIF.

  • ...

ENDIF.

ENDIF.

*>>>> END OF INSERTION <<<<<<

...

*&----


3 REPLIES 3
Read only

Former Member
0 Likes
841

Hi

Which your problem?

It seems the std code has to be changed because the sign of some countries are changed.

So you have to insert/delete the new code as the note explains:

- Insert the code between *>>>> START OF INSERTION <<<<

and *>>>> END OF INSERTION <<<<

- Delete the code between *>>>> START OF DELETION <<<<

and *>>>> END OF DELETION <<<<

So you should implement the user-exit indicate in the note.

Max

Read only

0 Likes
841

You can use the Transaction SNOTE to implement OSS Notes.

~Suresh

Read only

Former Member
0 Likes
841

I don't think this can be implemented through SNOTE. There is customization to be done and the code they provide is just "sample" code.

You should check with your functional consultant to make sure all steps are done.

Rob