documents in sem-bps and bw-bps

23
SAP (SAP America, Inc. and SAP AG) assumes no responsibility for errors or omissions in these materials. These materials are prov ided “as is” without a warranty o f any kind, either express or implied, including but not limited t o, the implied warrantie s of merchantability, fitness for a particular purpose, or non-infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completene ss of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may a ccess through the us e of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages. mySAP BI “How-To” papers are intended to simplify the product implementa tion. While specific product features and procedures typically are e xplaine d in a practic al business context, it is not implied that those features and procedures are the only appro ach in solving a specific bus iness problem using mySAP BI. Should you wish to receive additional information, clarification or support, please refer to SAP Prof essional Service s (Consulting/Remote Consulting). How t o… Documents in SEM-BPS and BW - BP S SEM-BPS/BW-BPS Applicable Releases: SEM 3.1B - SEM-BPS 3.5, BW-BPS 3.5

Upload: kksrisri

Post on 07-Apr-2018

232 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 1/23

SAP (SAP America, Inc. and SAP AG) assumes no responsibility for errors or omissions in these materials.

These materials are provided “as is” without a warranty of any kind, either express or implied, including but not limited to, the impliedwarranties of merchantability, fitness for a particular purpose, or non-infringement.

SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages thatmay result from the use of these materials.

SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within thesematerials. SAP has no control over the information that you may access through the use of hot links contained in these materials anddoes not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages.

mySAP BI “How-To” papers are intended to simplify the product implementation. While specific product features and procedurestypically are explained in a practical business context, it is not implied that those features and procedures are the only approach insolving a specific business problem using mySAP BI. Should you wish to receive additional information, clarification or support,please refer to SAP Professional Services (Consulting/Remote Consulting).

How to…

Documents in SEM-BPS

and BW-BPS

SEM-BPS/BW-BPS

Applicable Releases: SEM 3.1B - SEM-BPS 3.5, BW-BPS 3.5

Page 2: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 2/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

1 Sample Scenarios - Description__________________________________________________________2

1.1 Copy Documents using a Planning Function___________________________________________2

1.2 Delete Documents using a Planning Function__________________________________________2

 2 General Hints ________________________________________________________________________2

 3 Sample Scenarios: The Step By Step Solution ______________________________________________6 

3.1 Introduction _____________________________________________________________________6

3.2 Basics __________________________________________________________________________6

3.3 The Delete Function ______________________________________________________________6

3.4 The Copy Function _______________________________________________________________7

3.4.1 Creating the planning function ______________________________________________________7

3.4.2 Creating the parameter group _______________________________________________________8

Page 3: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 3/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

1 Sample Scenarios - Description

1.1 Document handling in the SEM-BPS/BW-BPS

In the SEM-BPS/BW-BPS the user can attach documents (type MS Word, MS PowerPoint, MSExcel or Plain Text) to certain combinations of characteristic values and keyfigure values. One wayto use documents is to enable the document functionality in the manual planning and to createdocuments that are attached to the characteristic combination (including a keyfigure) that is definedby a cell in a layout. The documents are stored in the Knowledge Warehouse and thus areaccessible in the BW as well. As the Knowledge Warehouse offers functionality for documentmanagement (such as copying, deleting, etc.) the SEM-BPS/BW-BPS only provides the followingfunctionality: to create, view, or delete single documents.

The key that is used to store the documents is made up from characteristic values and possiblykeyfigures. Only those characteristics can be used as keys that are “commentable”. You can switchthat feature on in the BW Info Object maintenance by setting the flag “Characteristic is documentattrib.”.

1.2 Copy Documents using a Planning Function

As the documents hold comments about specific plan data and thus are closely related to the datacustomers also want to treat documents together with the data, e.g. copy documents to a newversions whenever the plan data is copied to that version. This should be done with a planningfunction, as thus the functionality is accessible in all front ends alike and also can be combined witha copy function (for plan data) in a planning sequence.

The planning function must do a physical copy of the documents on the database. If you want toaccess the same document in say two different versions it is better not to mark version as beingcommentable as thus the version will be ignored when selecting the documents.

1.3 Delete Documents using a Planning Function

In the SEM-BPS/BW-BPS documents can only be deleted one by one. If data records are deletedthe documents related to that data are not deleted. There are a number of reasons why the systembehaves this way. On the other hand sometimes the documents should be deleted together with theplan data. Again this functionality should be realized in a planning function.

2 General HintsThe SEM-BPS/BW-BPS offers two different ways to display documents:

Page 4: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 4/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

1. The document functionality in the Planning Framework (predefined method 0-DOC). Thefunctionality is accessible via a node in the lower tree and displays all documents that belongto a certain selection given by the selected package. This function displays a list of alldocuments that contain relevant selections for all (commentable) characteristics that are inthe planning level. If a document has selections for additional characteristics (and thus beingdefined in a level that is implicitly contained in the planning level) it will be shown as well.Documents created or displayed with this functionality need not contain a keyfigure in theselection.

2. The document functionality in the Manual Planning/Web. The functionality is available for alayout if it is switched to “read documents” in the layout builder. Documents can be attachedto plan data in cells (or columns in the Web). Only those documents will be shown that haverelevant selections for exactly the commentable characteristics of the planning level and thatalso have a selection for a keyfigure. Documents that have additional characteristics in theselection or do not have a keyfigure in the selection will not be shown.

Page 5: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 5/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

Example:

Characteristics in the planning level (all commentable):

0VERSION

0CUSTOMER

0COUNTRY

Keyfigure in the planning level:

0REVENUE

Selection (planning package/level)

0VERSION: 1-2 0CUSTOMER: 0001-1000

0COUNTRY: GB, DE, FR, US

Selection for Document 1:

0VERSION: 1

Page 6: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 6/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

0CUSTOMER: 0002

0COUNTRY: GB

Keyfigure: 0REVENUE

The document can be seen in both cases

Selection for Document 2:

0VERSION: 1

0CUSTOMER: 0002

0COUNTRY: GB

0REGION: 001

Keyfigure: 0REVENUE

If the characteristic 0REGION is commentable then the document will NOT appear in a layout butcan be seen using the document functionality (0-DOC) in the framework. If on the other hand thecharacteristic 0REGION is NOT commentable then the characteristic will be ignored and thedocument can be seen in both cases.

Selection for Document 2:

0VERSION: 1

0CUSTOMER: 0002

0COUNTRY: GB

The selection does not contain a keyfigure and therefore the document will NOT be visible in alayout but in the framework document functionality 0-DOC.

Page 7: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 7/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

3 Sample Scenarios: The Step By Step Solution

3.1 Introduction

In this paper we want to show how a copy function and a delete function for documents can be usedin the SEM-BPS/BW-BPS. From release 3.1B, Support Package 14 and release 3.2, Support Pack10 and higher releases there are shipped realizations for such functions done as planning functionstype exit. The same function modules are described in OSS Note 583994.

The logic how these functions work and how they are to be used will be explained in this paper.

3.2 Basics

The shipped versions of the planning functions for copying and deleting documents can be found inthe function group UPFX. If you do not find the function modules in your system you can also createexit and init function modules (with the proper interfaces!) and copy the coding included furtherdown.

Note that both function save the changes in the documents to the database after executionautomatically!

3.3 The Delete Function

We start with the planning function that is deleting documents, as this one is easier to understandand to handle.

In order to create this planning function go to the framework (transaction BPS0) and in anappropriate level create a planning function type Exit. Enter “UPF_DOC_DEL_INIT” as name of theInit function and “UPF_DOC_DEL_EXIT” for the Exit function itself (note that the Exit function

module is empty – all the work will be done in the Init function module).The Exit function will select the plan data specified by the planning package. The shippedimplementation of the function modules will on the other hand not change the plan data. In order tospeed the execution of the planning function one should select all fields as fields to be changed.Thus the exit is only called once as only one subset is formed and as the plan data is not changed nomaster data checks will be performed.

The shipped implementation for the delete function does not require any exit parameters.

The selection for the documents to be deleted will be taken from the package selection. You can usethe planning function like a normal planning function in any Web Interface, planning folder orplanning sequence.

Page 8: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 8/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

3.4 The Copy Function

If you use the standard copy function in the BPS you have to define the source and the target of thecopying process. The target has to be contained in the selection of the planning package, theinformation which source will be copied to which target is given in the parameter group. The exitfunction delivered in the function group UPFX is based on the same concept.

3.4.1 Creating the planning function

In order to create the planning function you again have to access the planning framework and createa planning function type Exit. Enter “UPF_DOC_COPY_INIT” as name of the init function and“UPF_DOC_COPY_EXIT” for the Exit function itself (note that the Exit function module again isempty – all the work will be done in the Init function module). As we have no other option to definethe parameter group we will use the exit parameters.

For defining the rules for the copying you have to specify the characteristic, the “from” value and the“to” value. Thus the exit parameters will be used as triples: the first value specifies the characteristic,the second value is the “from” value, and the third value is the “to” value. The next value againspecifies a characteristic and so on. As the actual values for the exit parameters in the parametergroup might get reordered when saving to the database the names of the exit parameters shouldstart with numbers. As data elements you can use some standard SEM-BPS/BW-BPS dataelements: UPC_Y_CHANM for the name of the characteristics and UPC_Y_LOW for the “from” andthe “to” values. You can also define and use your own data elements (they should be of typecharacter and length 60) with “From value” and “To value” as text.

Page 9: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 9/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

You can use as many of those triples as necessary provided that the characteristic is contained inthe level. Triples for characteristics that are not commentable will be ignored. As the fields to bechanged will not be used within the exit you should choose all characteristics as to be changed forperformance reasons (see above).

3.4.2 Creating the parameter group

As with a normal planning function type copy you can use different parameter groups. In theparameter groups the exit parameters are filled with the name of the characteristic(s), the “from” andthe “to” values.

Characteristics:

For the characteristics you have to use the technical name (e.g. 0BPS_CNTRY). If you want to copyfrom one keyfigure to another you have to enter “_BKENNZAHL” for the characteristic.

“From” and “to” values:

In these fields you enter the value for the characteristic in the external format. Please make sure thatthe value is not longer than 60 characters (a value might be up to 70 characters) as by definition exitparameters can only have 60 characters. If you want to copy between keyfigures and have entered“_BKENNZAHL” as characteristic please enter the technical names of the keyfigures.

Page 10: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 10/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

You can also use variables for specifying the “from” and the “to” value. Enter manually the name ofthe variable in the relevant field. Please make sure that your variable has a name that is not identicalwith some characteristic value. The system will check at runtime that the variable contains only onesingle value. If the variable contains an interval and/or several single values the system will stop theexecution of the planning function.

In this example we copy documents from country ‘DE’ to a country that is specified by a variablecalled “VARCOUNT” and from the keyfigure “0BPS_COGS” to the keyfigure “0BPS_DMEXP”.

Please note that the target must be contained in the package that you use for executing the planningfunction. As with normal planning functions the “from” values do not have to be contained in theselection. If you do not fill the “from” or the “to” value for some characteristic the planning functionwill produce an error.

4 Coding of the shipped Exits

4.1 The Delete Function

4.1.1 UPF_DOC_DEL_INIT

Page 11: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 11/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

F U NC T I ON U PF _ D OC _ D EL _ I N I T .* " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -* " * " I n t e r f a c e :* " I MP ORT I NG* " R EF E RE NC E( I _ A R EA ) T Y P E UP C_ Y _ A R EA* " R EF E RE NC E( I _ P L E V E L ) T Y P E U PC _ Y _ P L E VE L* " R E F ER EN CE ( I _ P A C K AGE ) T Y P E U PC _ Y _ P A C KA GE

* " R E F ER EN CE ( I _ ME T H OD ) T Y P E U PC _ Y _ ME T H OD* " R EF E RE NC E( I _ P A RA M) T Y P E U PC_ Y _ P A RA M* " RE F ERE NCE ( I T _ E XI T P ) T Y PE UP F _ YT _ E XI T P* " R E F ER EN CE ( I T O_ C H AS E L ) T Y P E U P C_ Y T O _ C HA S E L* " R E F ER EN CE ( I T O_ C H A) T Y P E U P C_ Y T O _ C HA* " R EF E RE NC E( I T O_ K Y F ) T Y P E U PC_ Y T O_ K Y F* " E XP ORT I NG* " R E F ER EN CE ( E T O_ C H AS ) T Y P E A NY T A B L E* " R E F ER EN CE ( E T _ ME S G) T Y P E U P C_ Y T _ ME S G* " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

* T h i s p l a n n i n g f u n c t i o n d e l e t e s a l l d o c u me n t s s e l e c t e d i n t h e* p l a n n i n g p a c k a g e . T h i s a p p l i e s t o a l l d o c u me n t s t h a t a r e* d e f i n e d o n t h e s a me l e v e l o f a g g r e g a t i o n a s t h e p l a n n i n g f u n c t i o n ,* i . e . o n l y t h o s e d o c u me n t s a r e d e l e t e d t h a t a r e v i s i b l e i n a l a y o u t* u s i n g t h e s a me p a c k a g e .

* T h e f r a me wo r k d o e s o n l y c a l l t h e s a v e me t h o d f o r d o c u me n t s* i f f a n y d o c u me n t f u n c t i o n a l i t y i s s t a r t e d f r o m t h e f r a me wo r k .* A s t h e f r a me wo r k d o e s n o t k n o w a b o u t t h e d o c u me n t s c r e a t e d i n* t h i s c u s t o me r e x i t f u n c t i o n t h e s a v e mu s t b e c a l l e d h e r e . T h u s* d o c u me n t s a r e a l wa y s s a v e d wh e n t h i s f u n c t i o n i s c a l l e d .

d a t a : l r _ d o c t y p e r e f t o CL _ S EM_ MP _ DOCUME NT S,l r _ a r e a _ a t t r t y p e r e f t o c l _ s e m_ p l a n a r e a _ a t t r i b u t e s .

d a t a : l t o _ d o c t y p e U PC_ Y T O_ DOC,l t o _ d o c u me n t _ l o n g t y p e u p c _ y t o _ d o c u me n t _ l o n g ,l t o _ c h a t y p e u p c _ y t o _ c h a ,

l t o _ c h a _ c o m t y p e u p c _ y t o _ c h a ,l t o _ p l e v e l k t y p e U P C_ YT O_ K Y F ,l t o _ c h a s e l l i k e i t o _ c h a s e l ,l s _ c h a t y p e u p c _ y s _ c h a ,l s _ c h a p r o t y p e u p c _ y s _ c h a p r o ,l s _ me s g t y p e u p c _ y s _ me s g ,l s _ d o c t y p e u p c _ y s _ d o c ,l s _ d o c u me n t _ l o n g t y p e u p c _ y s _ d o c u me n t _ l o n g ,l s _ k y f t y p e UP C_ Y S_ K YF ,l s _ c h a s e l t y p e UP C_ Y S_ CHA SE L ,l s _ c h a r n g t y p e u p c _ y s _ c h a r n g .

l t o _ c h a s e l = i t o _ c h a s e l .

* g e t t h e l i s t o f c h a r a c t e r s f r o m t h e l e v e lC AL L F U N CT I ON ' U P C_ P L E V E L _ G E T '

E X P OR T I N GI _ A RE A = i _ a r e aI _ P L EV E L = i _ p l e v e l

I MP OR TI N GE TO_ P L EV EL C = l t o _ c h aE T O_ PL EV E L K = l t o _ p l e v e l k

E X CE P T I ON SN O_ E X I S T E NC E = 1L O C K E D = 2

Page 12: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 12/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

N O_ C O NS I S T E N C E = 3OT H E R S = 4 .

I F S Y- S UB RC < > 0 .l s _ me s g - ms g i d = s y - ms g i d . l s _ me s g - ms g t y = s y - ms g t y .l s _ me s g - ms g n o = s y - ms g n o . l s _ me s g - ms g v 1 = s y - ms g v 1 .l s _ me s g - ms g v 2 = s y - ms g v 2 . l s _ me s g - ms g v 3 = s y - ms g v 3 .l s _ me s g - ms g v 4 = s y - ms g v 4 .

a p p e n d l s _ me s g t o e t _ me s g .e x i t .

E ND I F .

* g e t a n i n s t a n c e o f t h e p l a n a r e aC A L L ME T H OD C L _ S E M_ P L A N A RE A _ A T T R I B U T E S = > G E T _ I N S T A N CE

E X P OR T I N GI _ A RE A = i _ a r e a

RE CE I V I NGE R_ I NS T ANCE = l r _ a r e a _ a t t r

E X CE P T I ON SF A I L E D = 1o t h e r s = 2 .

I F S Y- S UB RC < > 0 .l s _ me s g - ms g i d = s y - ms g i d . l s _ me s g - ms g t y = s y - ms g t y .l s _ me s g - ms g n o = s y - ms g n o . l s _ me s g - ms g v 1 = s y - ms g v 1 .l s _ me s g - ms g v 2 = s y - ms g v 2 . l s _ me s g - ms g v 3 = s y - ms g v 3 .l s _ me s g - ms g v 4 = s y - ms g v 4 .a p p e n d l s _ me s g t o e t _ me s g .e x i t .

E ND I F .

c l e a r l t o _ c h a _ c o m.

* f i l l t h e t a b l e o f c h a r s t h a t c a n h a v e a c o mme n tl o o p a t l t o _ c h a i n t o l s _ c h a .

r e a d t a b l e l r _ a r e a _ a t t r - > t o _ c h a p r o i n t o l s _ c h a p r owi t h t a b l e k e y c h a n m = l s _ c h a - c h a n m.

i f l s _ c h a p r o - B DS F L i s i n i t i a l .

d e l e t e l t o _ c h a s e l wh e r e c h a n m = l s _ c h a - c h a n m.e l s e .

i n s e r t l s _ c h a i n t o t a b l e l t o _ c h a _ c o m.e n d i f .

e n d l o o p .

i f l t o _ c h a _ c o m i s i n i t i a l .* me s s a g e i 0 0 8 r a i s i n g f a i l e d .

e x i t .e n d i f .

l s _ c h a - c h a n m = c l _ s e m_ mp _ d o c u me n t s = > c _ n a me _ k e y f .i n s e r t l s _ c h a i n t o t a b l e l t o _ c h a _ c o m.

* w e i n s e r t a s e l e c t i o n f o r t h e k e y f i g u r e - e x a c t l y t h e o n e s t h a t a r e* i n t h e l e v e l

c l e a r l s _ c h a s e l .l s _ c h a s e l - c h a n m = c l _ s e m_ mp _ d o c u me n t s = > c _ n a me _ k e y f .

l o o p a t l t o _ p l e v e l k i n t o l s _ k y f .l s _ c h a r n g - s i g n = ' I ' .l s _ c h a r n g - o p t i o n = ' E Q' .l s _ c h a r n g - l o w = l s _ k y f - k y f n m.c l e a r l s _ c h a r n g - h i g h .a p p e n d l s _ c h a r n g t o l s _ c h a s e l - t _ c h a r n g .

Page 13: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 13/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

e n d l o o p .i f n o t l s _ c h a s e l - t _ c h a r n g i s i n i t i a l .

i n s e r t l s _ c h a s e l i n t o t a b l e l t o _ c h a s e l .e n d i f .

* g e t a o b j e c t o f t h e b u f f e r c l a s sC A L L M E T H OD C L _ S E M_ MP _ D OC U ME N T S = > G E T _ I N S T A N C E

E X P OR T I N GI _ A RE A = i _ a r e a

RE CE I V I NGE R_ I NS TA NCE = l r _ d o c .

* l o a d t h e d o c u me n t sC A L L ME T H OD L R _ D O C- > G E T _ D OC UME N T _ L I S T

E X P OR T I N GI T O_ CHA = l t o _ c h a _ c o mI T O_ CHA S EL = l t o _ c h a s e l

I MP OR TI N GE T O_ D OCUME NT _ L ONG = l t o _ d o c u me n t _ l o n g

E X CE P T I ON SF A I L E D = 1o t h e r s = 2 .

I F S Y- S UB RC < > 0 .l s _ me s g - ms g i d = s y - ms g i d . l s _ me s g - ms g t y = s y - ms g t y .l s _ me s g - ms g n o = s y - ms g n o . l s _ me s g - ms g v 1 = s y - ms g v 1 .l s _ me s g - ms g v 2 = s y - ms g v 2 . l s _ me s g - ms g v 3 = s y - ms g v 3 .l s _ me s g - ms g v 4 = s y - ms g v 4 .a p p e n d l s _ me s g t o e t _ me s g .e x i t .

E ND I F .

c l e a r l t o _ d o c .

l o o p a t l t o _ d o c u me n t _ l o n g i n t o l s _ d o c u me n t _ l o n g .l s _ d o c - DOC_ I D = l s _ d o c u me n t _ l o n g - DOC_ I D.l s _ d o c - DOC_ S OURCE = ' D' .

l s _ d o c - DOC_ T I T L E = l s _ d o c u me n t _ l o n g - DOC_ T I T L E.l s _ d o c - DOC_ S I Z E = l s _ d o c u me n t _ l o n g - DOC_ S I Z E.l s _ d o c - DOC_ T YP E = l s _ d o c u me n t _ l o n g - DOC_ T YP E.l s _ d o c - T O_ CHA V L = l s _ d o c u me n t _ l o n g - T O_ CHA VL .l s _ d o c - A RE A = i _ a r e a .l s _ d o c - t o d o = ' D' .i n s e r t l s _ d o c i n t o t a b l e l t o _ d o c .

e n d l o o p .

* w r i t e t o b u f f e rC AL L ME T HOD l r _ d o c - > U PD AT E _ D OCU ME NT _ L I S T

E X P OR T I N GI T O_ DOC = l t o _ d o cI T O_ C H A = l T O_ C H A_ C OM

E X CE P T I ON SF A I L E D = 1o t h e r s = 2 .

I F S Y- S UB RC < > 0 .l s _ me s g - ms g i d = s y - ms g i d . l s _ me s g - ms g t y = s y - ms g t y .l s _ me s g - ms g n o = s y - ms g n o . l s _ me s g - ms g v 1 = s y - ms g v 1 .l s _ me s g - ms g v 2 = s y - ms g v 2 . l s _ me s g - ms g v 3 = s y - ms g v 3 .l s _ me s g - ms g v 4 = s y - ms g v 4 .a p p e n d l s _ me s g t o e t _ me s g .e x i t .

E ND I F .

Page 14: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 14/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

* T h e f r a me wo r k d o e s o n l y c a l l t h e s a v e me t h o d f o r d o c u me n t s* i f f a n y d o c u me n t f u n c t i o n a l i t y i s s t a r t e d f r o m t h e f r a me wo r k .* A s t h e f r a me wo r k d o e s n o t k n o w a b o u t t h e d o c u me n t s c r e a t e d i n* t h i s c u s t o me r e x i t f u n c t i o n t h e s a v e mu s t b e c a l l e d h e r e . T h u s* d o c u me n t s a r e a l wa y s s a v e d wh e n t h i s f u n c t i o n i s c a l l e d .

C A L L M E T H O D C L _ S E M _ M P _ D O C U M E N T S = > S A V E

E X P OR T I N GI _ S A V E_ MOD E = ' D '

E X CE P T I ON SF A I L E D = 1o t h e r s = 2 .

I F S Y- S UB RC < > 0 .l s _ me s g - ms g i d = s y - ms g i d . l s _ me s g - ms g t y = s y - ms g t y .l s _ me s g - ms g n o = s y - ms g n o . l s _ me s g - ms g v 1 = s y - ms g v 1 .l s _ me s g - ms g v 2 = s y - ms g v 2 . l s _ me s g - ms g v 3 = s y - ms g v 3 .l s _ me s g - ms g v 4 = s y - ms g v 4 .a p p e n d l s _ me s g t o e t _ me s g .e x i t .

E ND I F .

E N D F U NC T I ON .

4.1.2 UPF_DOC_DEL_EXIT

F U NC T I ON U PF _ D OC _ D EL _ E X I T .* " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -* " * " I n t e r f a c e :* " I MP ORT I NG* " R EF E RE NC E( I _ A R EA ) T Y P E UP C_ Y _ A R EA* " R EF E RE NC E( I _ P L E V E L ) T Y P E U PC _ Y _ P L E VE L* " R E F ER EN CE ( I _ ME T H OD ) T Y P E U PC _ Y _ ME T H OD* " R EF E RE NC E( I _ P A RA M) T Y P E U PC_ Y _ P A RA M* " R E F ER EN CE ( I _ P A C K AGE ) T Y P E U PC _ Y _ P A C KA GE* " RE F ERE NCE ( I T _ E XI T P ) T Y PE UP F _ YT _ E XI T P* " R E F ER EN CE ( I T O_ C H AS E L ) T Y P E U P C_ Y T O _ C HA S E L* " R E F ER EN CE ( I T O_ C H A) T Y P E U P C_ Y T O _ C HA* " R EF E RE NC E( I T O_ K Y F ) T Y P E U PC_ Y T O_ K Y F* " E XP ORT I NG* " R E F ER EN CE ( E T _ ME S G) T Y P E U P C_ Y T _ ME S G* " CHA NGI NG* " R E F ER EN CE ( X T H _ D AT A ) T Y P E H AS H ED T A B L E* " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

e x i t .

E N D F U NC T I ON .

Page 15: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 15/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

4.2 The Copy Function

4.2.1 UPF_DOC_COPY_INIT

F UNCT I ON u p f _ d o c _ c o p y _ i n i t .* " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

* " * " I n t e r f a c e :* " I MP ORT I NG* " R EF E RE NC E( I _ A R EA ) T Y P E UP C_ Y _ A R EA* " R EF E RE NC E( I _ P L E V E L ) T Y P E U PC _ Y _ P L E VE L* " R E F ER EN CE ( I _ P A C K AGE ) T Y P E U PC _ Y _ P A C KA GE* " R E F ER EN CE ( I _ ME T H OD ) T Y P E U PC _ Y _ ME T H OD* " R EF E RE NC E( I _ P A RA M) T Y P E U PC_ Y _ P A RA M* " RE F ERE NCE ( I T _ E XI T P ) T Y PE UP F _ YT _ E XI T P* " R E F ER EN CE ( I T O_ C H AS E L ) T Y P E U P C_ Y T O _ C HA S E L* " R E F ER EN CE ( I T O_ C H A) T Y P E U P C_ Y T O _ C HA* " R EF E RE NC E( I T O_ K Y F ) T Y P E U PC_ Y T O_ K Y F* " E XP ORT I NG* " R E F ER EN CE ( E T O_ C H AS ) T Y P E A NY T A B L E* " R E F ER EN CE ( E T _ ME S G) T Y P E U P C_ Y T _ ME S G* " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

* T h i s f u n c t i o n i s u s e d f o r c o p y i n g d o c u me n t s f r o m a s e t o f* c h a r a c t e r i s t i c c o mb i n a t i o n s t o a n o t h e r . A s wi t h a n o r ma l p l a n n i n g* f u n c t i o n o f t y p e c o p y t h e T A RGE T i s s p e c i f i e d b y t h e p l a n n i n g p a c k a g e .* T h e " f r o m" a n d " t o " v a l u e s a r e s p e c i f i e d b y t h e p a r a me t e r g r o u p .* N o t e t h a t o n l y d o c u me n t s a r e c o p i e d t h a t a r e d e f i n e d i n t h e s a me l e v e l* o f a g g r e g a t i o n , i . e . a l l d o c u me n t s a r e c o p i e d t h a t a r e v i s i b l e i n a* l a y o u t i n t h e s a me p l a n n i n g l e v e l .

* F o r s p e c i f y i n g t h e " f r o m" a n d " t o " v a l u e s we u s e t h e e x i t p a r a me t e r s* i n t h e p a r a me t e r g r o u p . F o r e a c h c h a r a c t e r i s t i c we u s e 3 p a r a me t e r s :* 1 . Na me o f t h e c h a r a c t e r i s t i c* 2 . F r o m- v a l u e ( s i n g l e v a l u e r e q u i r e d )* 3 . T o - v a l u e ( s i n g l e v a l u e r e q u i r e d )

* T h i s g r o u p h a s t o b e r e p e a t e d f o r e v e r y c h a r a c t e r i s t i c u s e d .

* T h e v a l u e s h a v e t o b e e n t e r e d i n t h e e x t e r n a l f o r ma t . E a c h f i e l d* h a s t o b e f i l l e d . Ma k e s u r e t h a t t h e e x t e r n a l v a l u e i s n o t* l o n g e r t h a n 6 0 c h a r a c t e r s a s t h i s i s t h e l i mi t f o r t h e f i e l d s* i n t h e e x i t p a r a me t e r s .** I n s t e a d o f e n t e r i n g a c h a r a c t e r i s t i c v a l u e y o u c a n e n t e r t h e n a me o f* a v a r i a b l e d e f i n e d i n t h e s a me p l a n n i n g a r e a ( y o u c a n n o t u s e t h e* v a r i a b l e b u t t o n b u t h a v e t o e n t e r t h e n a me ma n u a l l y ) . A t r u n t i me t h e* s y s t e m wi l l f i r s t c h e c k wh e t h e r t h e e n t r y i n a n e x i t p a r a me t e r i s* t h e n a me o f a v a r i a b l e . T h u s y o u s h o u l d n o t c r e a t e v a r i a b l e s t h a t* h a v e t h e s a me n a me a s a c h a r a c t e r i s t i c v a l u e .

* I f t h e s y s t e m d e t e c t s a v a r i a b l e i t w i l l* c h e c k t h a t t h e v a r i a b l e i s f i l l e d wi t h e x a c t l y o n e v a l u e . I f t h e* v a r i a b l e i s n o t f i l l e d o r i t i s f i l l e d w i t h mo r t h a n a s i n g l e v a l u e* t h e s y s t e m wi l l s t o p t h e p l a n n i n g f u n c t i o n .

* He r e a n e x a mp l e h o w t h e d e f i n i t i o n o f t h e f u n c t i o n s h o u l d* l o o k l i k e u s i n g t wo c h a r a c t e r i s t i c s . P l e a s e f o l l o w t h e n a mi n g* c o n v e n t i o n w i t h t h e l e a d i n g d i g i t s i n o r d e r t o h a v e a c l e a r* g r o u p i n g a n d o r d e r :

* P a r a me t e r n a me Da t a e l e me n t

Page 16: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 16/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

* 1 1 CHA NM UP C_ Y _ CHA NM* 1 2 F R OM U P C_ Y _ L O W* 1 3 T O U PC _ Y _ L OW* 2 1 CHA NM UP C_ Y _ CHA NM* 2 2 F R OM U P C_ Y _ L O W* 2 3 T O U PC _ Y _ L OW

* T h e f r a me wo r k d o e s o n l y c a l l t h e s a v e me t h o d f o r d o c u me n t s* i f f a n y d o c u me n t f u n c t i o n a l i t y i s s t a r t e d f r o m t h e f r a me wo r k .* A s t h e f r a me wo r k d o e s n o t k n o w a b o u t t h e d o c u me n t s c r e a t e d i n* t h i s c u s t o me r e x i t f u n c t i o n t h e s a v e mu s t b e c a l l e d h e r e . T h u s* d o c u me n t s a r e a l wa y s s a v e d wh e n t h i s f u n c t i o n i s c a l l e d .

DA TA : l r _ d o c T YP E RE F T O c l _ s e m_ mp _ d o c u me n t s ,l r _ a r e a _ a t t r T YP E RE F T O c l _ s e m_ p l a n a r e a _ a t t r i b u t e s .

DA T A: l t o _ d o c T YP E u p c _ y t o _ d o c ,l t o _ c h a T YP E u p c _ y t o _ c h a ,l t o _ c h a _ c o m T YP E u p c _ y t o _ c h a ,l t o _ p l e v e l k T Y P E u p c _ y t o _ k y f ,l t o _ d o c u me n t _ l o n g T YP E u p c _ y t o _ d o c u me n t _ l o n g ,l t o _ c h a s e l L I K E i t o _ c h a s e l ,l s _ c h a T Y P E u p c _ y s _ c h a ,l s _ c h a s e l T YP E u p c _ y s _ c h a s e l ,l s _ c h a r n g T Y P E u p c _ y s _ c h a r n g ,l s _ c h a p r o T Y P E u p c _ y s _ c h a p r o ,l s _ e x i t p L I K E L I NE OF i t _ e x i t p ,l s _ c h a v l T YP E u p c _ y s _ c h a d e p ,l s _ k y f T YP E u p c _ y s _ k y f ,l s _ me s g T Y PE u p c _ y s _ me s g ,l s _ d o c T Y P E u p c _ y s _ d o c ,l s _ d o c u me n t _ l o n g T Y P E u p c _ y s _ d o c u me n t _ l o n g .

T Y P E S :B EGI N OF y s _ f r o m_ t o ,

c h a n m T Y P E u p c _ y _ c h a n m ,

f r o m T YP E u p c _ y _ l o w,t o T YP E u p c _ y _ l o w,

E ND OF y s _ f r o m_ t o ,

y t _ f r o m_ t o T Y PE ST ANDA RD T AB L E OF y s _ f r o m_ t o .

DA T A: l s _ f r o m_ t o T Y P E y s _ f r o m_ t o ,l t _ f r o m_ t o T Y P E y t _ f r o m_ t o .

DA T A: l _ c n t r T YP E n ,l _ s u b r c L I K E s y - s u b r c ,l _ e x i t T Y P E c ,l _ l i n e s t y p e i .

l t o _ c h a s e l = i t o _ c h a s e l .

* g e t t h e l i s t o f c h a r a c t e r s f r o m t h e l e v e lC AL L F U N CT I ON ' U P C_ P L E V E L _ G E T '

E X P OR T I N Gi _ a r e a = i _ a r e ai _ p l e v e l = i _ p l e v e l

I MP OR TI N Ge t o _ p l e v e l c = l t o _ c h ae t o _ p l e v e l k = l t o _ p l e v e l k

E X CE P T I ON S

Page 17: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 17/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

n o _ e x i s t e n c e = 1l o c k e d = 2n o _ c o n s i s t e n c e = 3OT H E R S = 4 .

I F s y - s u b r c < > 0 .l s _ me s g - ms g i d = s y - ms g i d . l s _ me s g - ms g t y = s y - ms g t y .l s _ me s g - ms g n o = s y - ms g n o . l s _ me s g - ms g v 1 = s y - ms g v 1 .

l s _ me s g - ms g v 2 = s y - ms g v 2 . l s _ me s g - ms g v 3 = s y - ms g v 3 .l s _ me s g - ms g v 4 = s y - ms g v 4 .A PP END l s _ me s g T O e t _ me s g .E XI T .

E ND I F .

* g e t a n i n s t a n c e o f t h e p l a n a r e aCA L L ME T HOD c l _ s e m_ p l a n a r e a _ a t t r i b u t e s = > g e t _ i n s t a n c e

E X P OR T I N Gi _ a r e a = i _ a r e a

RE CE I V I NGe r _ i n s t a n c e = l r _ a r e a _ a t t r

E X CE P T I ON Sf a i l e d = 1OT H E R S = 2 .

I F s y - s u b r c < > 0 .l s _ me s g - ms g i d = s y - ms g i d . l s _ me s g - ms g t y = s y - ms g t y .l s _ me s g - ms g n o = s y - ms g n o . l s _ me s g - ms g v 1 = s y - ms g v 1 .l s _ me s g - ms g v 2 = s y - ms g v 2 . l s _ me s g - ms g v 3 = s y - ms g v 3 .l s _ me s g - ms g v 4 = s y - ms g v 4 .A PP END l s _ me s g T O e t _ me s g .E XI T .

E ND I F .

CL E AR l t o _ c h a _ c o m.

* f i l l t h e t a b l e o f c h a r s t h a t c a n h a v e a c o mme n tL OOP A T l t o _ c h a I NT O l s _ c h a .

RE A D T A B L E l r _ a r e a _ a t t r - > t o _ c h a p r o I NT O l s _ c h a p r o

WI T H T A BL E KE Y c h a n m = l s _ c h a - c h a n m.I F l s _ c h a p r o - b d s f l I S I N I T I A L .

DE L ET E l t o _ c h a s e l WHE RE c h a n m = l s _ c h a - c h a n m.E L S E .

I NS ERT l s _ c h a I NT O T AB L E l t o _ c h a _ c o m.E NDI F .

EN D L O O P.

I F l t o _ c h a _ c o m I S I N I T I A L .* me s s a g e i 0 0 8 r a i s i n g f a i l e d .

E XI T .E ND I F .

l s _ c h a - c h a n m = c l _ s e m_ mp _ d o c u me n t s = > c _ n a me _ k e y f .I NS ERT l s _ c h a I NT O T AB L E l t o _ c h a _ c o m.

* w e i n s e r t a s e l e c t i o n f o r t h e k e y f i g u r e - e x a c t l y t h e o n e s t h a t a r e* i n t h e l e v e l

CL EA R l s _ c h a s e l .l s _ c h a s e l - c h a n m = c l _ s e m_ mp _ d o c u me n t s = > c _ n a me _ k e y f .

L OOP A T l t o _ p l e v e l k I NT O l s _ k y f .l s _ c h a r n g - s i g n = ' I ' .l s _ c h a r n g - o p t i o n = ' E Q' .l s _ c h a r n g - l o w = l s _ k y f - k y f n m.

Page 18: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 18/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

CL EA R l s _ c h a r n g - h i g h .A P P E ND l s _ c h a r n g T O l s _ c h a s e l - t _ c h a r n g .

EN D L O O P.I F NOT l s _ c h a s e l - t _ c h a r n g I S I N I T I A L .

I NS E RT l s _ c h a s e l I NT O T AB L E l t o _ c h a s e l .E ND I F .

* b u i l d u p a t t a b l e f o r c o p y i n gd e s c r i b e t a b l e i t _ e x i t p l i n e s l _ l i n e s .l _ l i n e s = l _ l i n e s mo d 3 .i f l _ l i n e s < > 0 .

e x i t .e n d i f .

CL EA R l _ e x i t .L OOP A T i t _ e x i t p I NT O l s _ e x i t p .

A DD 1 T O l _ c n t r .

CA S E l _ c n t r .WHE N ' 1 ' .

l s _ f r o m_ t o - c h a n m = l s _ e x i t p - c h a v l .

WHE N ' 2 ' .* c h e c k f o r v a r i a b l e s

P E RF ORM r e p l a c e _ v a r i a b l eUS I NG l s _ e x i t p - c h a v l i _ a r e a l s _ f r o m_ t o - c h a n mCHA NGI NG l s _ f r o m_ t o - f r o m l _ s u b r c e t _ me s g .

I F l _ s u b r c < > 0 .l _ e x i t = ' X ' .E XI T .

E ND I F .

WHE N ' 3 ' .* c h e c k f o r v a r i a b l e s

P E RF ORM r e p l a c e _ v a r i a b l eUS I NG l s _ e x i t p - c h a v l i _ a r e a l s _ f r o m_ t o - c h a n m

CHA NGI NG l s _ f r o m_ t o - t o l _ s u b r c e t _ me s g .I F l _ s u b r c < > 0 .

l _ e x i t = ' X ' .E XI T .

E ND I F .

* c h e c k t h a t t h e c h a r a c t a r i s t i c i s c o mme n t a b l eR EA D T A B L E l t o _ c h a _ c o m T RA NS P OR T I N G N O F I E L D S

WI T H K EY c h a n m = l s _ f r o m_ t o - c h a n m.I F s y - s u b r c = 0 .

A P P E ND l s _ f r o m_ t o T O l t _ f r o m_ t o .E ND I F .CL EA R l _ c n t r .

EN D C ASE.EN D L O O P.

CHE CK l _ e x i t I S I NI T I A L .

* a s wi t h p l a n n i n g f u n c t i o n s t h e s e l e c t i o n i n t h e p a c k a g e* d e t e r mi n e s t h e T A RGE T ! E x c h a n g e t h e v a l u e s i n t h e s e l e c t i o n b y t h e* f r o m v a l u e s i n t h e t a b l e f r o m_ t o . I f t h e s e l e c t i o n i n t h e p a c k a g e* i s b i g g e r t h e we r e s t r i c t i t .

L OOP A T l t _ f r o m_ t o I NT O l s _ f r o m_ t o .l s _ c h a s e l - c h a n m = l s _ f r o m_ t o - c h a n m.l s _ c h a r n g - s i g n = ' I ' .

Page 19: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 19/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

l s _ c h a r n g - o p t i o n = ' E Q' .l s _ c h a r n g - l o w = l s _ f r o m_ t o - f r o m.CL EA R l s _ c h a r n g - h i g h .

CL EA R l s _ c h a s e l - t _ c h a r n g .A P P E ND l s _ c h a r n g T O l s _ c h a s e l - t _ c h a r n g .

DE L E TE l t o _ c h a s e l WHE RE c h a n m = l s _ f r o m_ t o - c h a n m.I NS E RT l s _ c h a s e l I NT O T AB L E l t o _ c h a s e l .

EN D L O O P.

* g e t a o b j e c t o f t h e b u f f e r c l a s sCA L L ME THOD c l _ s e m_ mp _ d o c u me n t s = > g e t _ i n s t a n c e

E X P OR T I N Gi _ a r e a = i _ a r e a

RE CE I V I NGe r _ i n s t a n c e = l r _ d o c .

* l o a d t h e d o c u me n t sCA L L ME T HOD l r _ d o c - > g e t _ d o c u me n t _ l i s t

E X P OR T I N Gi t o _ c h a = l t o _ c h a _ c o mi t o _ c h a s e l = l t o _ c h a s e l

I MP OR TI N Ge t o _ d o c u me n t _ l o n g = l t o _ d o c u me n t _ l o n g

E X CE P T I ON Sf a i l e d = 1OT H E R S = 2 .

I F s y - s u b r c < > 0 .l s _ me s g - ms g i d = s y - ms g i d . l s _ me s g - ms g t y = s y - ms g t y .l s _ me s g - ms g n o = s y - ms g n o . l s _ me s g - ms g v 1 = s y - ms g v 1 .l s _ me s g - ms g v 2 = s y - ms g v 2 . l s _ me s g - ms g v 3 = s y - ms g v 3 .l s _ me s g - ms g v 4 = s y - ms g v 4 .A PP END l s _ me s g T O e t _ me s g .E XI T .

E ND I F .

CL E A R l t o _ d o c .L OOP AT l t o _ d o c u me n t _ l o n g I NT O l s _ d o c u me n t _ l o n g .

CL E AR l s _ d o c .

* c h a n g e t h e s e l e c t i o nL OOP AT l s _ d o c u me n t _ l o n g - t o _ c h a v l I NT O l s _ c h a v l .

RE AD T AB L E l t _ f r o m_ t o I NT O l s _ f r o m_ t o WI T H K E Yc h a n m = l s _ c h a v l - c h a n m F ROM = l s _ c h a v l - c h a v l i n t .

I F s y - s u b r c < > 0 .C ON T I N UE .

E ND I F .

DE L ET E T AB L E l s _ d o c u me n t _ l o n g - t o _ c h a v l F ROM l s _ c h a v l .

l s _ c h a v l - c h a v l i n t = l s _ f r o m_ t o - t o .I NS E RT l s _ c h a v l I NT O T AB L E l s _ d o c u me n t _ l o n g - t o _ c h a v l .

EN D L O O P.

* c r e a t e a g u i dC A L L F UN CT I ON ' GU I D _ C RE A T E '

I MP OR T I N Ge v _ g u i d _ 2 2 = l s _ d o c - d o c _ i d .

l s _ d o c - t o d o = ' I ' .

Page 20: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 20/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

l s _ d o c - d o c _ s o u r c e = ' D' .l s _ d o c - t o _ c h a v l = l s _ d o c u me n t _ l o n g - t o _ c h a v l .l s _ d o c - d o c _ t i t l e = l s _ d o c u me n t _ l o n g - d o c _ t i t l e .l s _ d o c - d o c _ s i z e = l s _ d o c u me n t _ l o n g - d o c _ s i z e .l s _ d o c - d o c _ t y p e = l s _ d o c u me n t _ l o n g - d o c _ t y p e .l s _ d o c - a r e a = i _ a r e a .

* g e t t h e c o n t e n tCA L L ME THOD l r _ d o c - > g e t _ d o c u me n t _ c o n t e n t

E X P OR T I N Gi _ d o c _ i d = l s _ d o c u me n t _ l o n g - d o c _ i d

I MP OR T I N Ge t _ c o n t e n t = l s _ d o c - t _ c o n t e n te t _ a s _ c o n t e n t = l s _ d o c - t _ a s _ c o n t e n t

E X CE P T I ON Sf a i l e d = 1n o _ d o c u me n t _ f o u n d = 2OT H E RS = 3 .

I F s y - s u b r c < > 0 .l s _ me s g - ms g i d = s y - ms g i d . l s _ me s g - ms g t y = s y - ms g t y .l s _ me s g - ms g n o = s y - ms g n o . l s _ me s g - ms g v 1 = s y - ms g v 1 .l s _ me s g - ms g v 2 = s y - ms g v 2 . l s _ me s g - ms g v 3 = s y - ms g v 3 .l s _ me s g - ms g v 4 = s y - ms g v 4 .A PP END l s _ me s g T O e t _ me s g .E X I T .

E NDI F .I NS E RT l s _ d o c I NT O T AB L E l t o _ d o c .

EN D L O O P.

* w r i t e t o b u f f e rCA L L ME THOD l r _ d o c - > u p d a t e _ d o c u me n t _ l i s t

E X P OR T I N Gi t o _ d o c = l t o _ d o ci t o _ c h a = l t o _ c h a _ c o m

E X CE P T I ON Sf a i l e d = 1

OT H E R S = 2 .I F s y - s u b r c < > 0 .

l s _ me s g - ms g i d = s y - ms g i d . l s _ me s g - ms g t y = s y - ms g t y .l s _ me s g - ms g n o = s y - ms g n o . l s _ me s g - ms g v 1 = s y - ms g v 1 .l s _ me s g - ms g v 2 = s y - ms g v 2 . l s _ me s g - ms g v 3 = s y - ms g v 3 .l s _ me s g - ms g v 4 = s y - ms g v 4 .A PP END l s _ me s g T O e t _ me s g .E XI T .

E ND I F .

* T h e f r a me wo r k d o e s o n l y c a l l t h e s a v e me t h o d f o r d o c u me n t s* i f f a n y d o c u me n t f u n c t i o n a l i t y i s s t a r t e d f r o m t h e f r a me wo r k .* A s t h e f r a me wo r k d o e s n o t k n o w a b o u t t h e d o c u me n t s c r e a t e d i n* t h i s c u s t o me r e x i t f u n c t i o n t h e s a v e mu s t b e c a l l e d h e r e . T h u s* d o c u me n t s a r e a l wa y s s a v e d wh e n t h i s f u n c t i o n i s c a l l e d .

CA L L ME T HOD c l _ s e m_ mp _ d o c u me n t s = > s a v eE X P OR T I N G

i _ s a v e _ mo d e = ' D 'E X CE P T I ON S

f a i l e d = 1OT H E R S = 2 .

I F s y - s u b r c < > 0 .l s _ me s g - ms g i d = s y - ms g i d . l s _ me s g - ms g t y = s y - ms g t y .l s _ me s g - ms g n o = s y - ms g n o . l s _ me s g - ms g v 1 = s y - ms g v 1 .l s _ me s g - ms g v 2 = s y - ms g v 2 . l s _ me s g - ms g v 3 = s y - ms g v 3 .

Page 21: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 21/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

l s _ me s g - ms g v 4 = s y - ms g v 4 .A PP END l s _ me s g T O e t _ me s g .E XI T .

E ND I F .

E N D F U NC T I ON .

* &- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ** & F o r m r e p l a c e _ v a r i a b l e* &- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ** t e x t* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ** - - > I _ CHA V L t e x t* - - > I _ ARE A t e x t* - - > I _ CHA NM t e x t* - - > X_ VA L UE t e x t* - - > X_ S UB RC t e x t* - - > XT _ ME SG t e x t* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *F ORM r e p l a c e _ v a r i a b l e U S I NG i _ c h a v l T YP E u p c _ y _ c h a v l i n t

i _ a r e a T Y P E u p c _ y _ a r e ai _ c h a n m T YP E u p c _ y _ c h a n m

CHA NGI NG x _ v a l u e T Y PE u p c _ y _ l o wx _ s u b r c L I K E s y - s u b r cx t _ me s g T YP E u p c _ y t _ me s g .

DA T A: l t o _ v a l u e T Y P E u p c _ y t o _ c h a r s e l ,l s _ v a l u e TY P E u p c _ y s _ c h a r s e l ,l r _ v a r i a b l e T Y P E RE F TO c l _ s e m_ v a r i a b l e ,l s _ me s g T Y PE u p c _ y s _ me s g ,l _ c h a v l e x t T Y P E u p c _ y _ c h a v l e x t ,l _ v a r n m T Y P E u p c _ y _ v a r i a b l e ,l _ l i n e s T Y P E i .

CL EA R: x _ s u b r c , x _ v a l u e .

CL A S S c l _ s e m_ mp _ d o c u me n t s D EF I NI T I ON L OA D.

* ma y b e we h a v e a v a r i a b l e - t r y t o r e p l a c e i t* d o e s t h e v a r i a b l e e x i s t ?

l _ v a r n m = i _ c h a v l .

CA L L ME T HOD c l _ s e m_ v a r i a b l e = > g e t _ i n s t a n c eE X P OR T I N G

i _ a r e a = i _ a r e ai _ v a r i a b l e = l _ v a r n m

RE CE I V I NGr r _ v a r i a b l e = l r _ v a r i a b l e

E X CE P T I ON SOT H E R S = 1 .

I F s y - s u b r c = 1 .* t h e v a r i a b l e d o e s n o t e x i s t - u s e t h e v a l u e a s a c h a r v a l u e* c o n v e r t f r o m e x t e r n a l i n t o i n t e r n a l f o r ma t i f i t i s n o t a k e y f .

I F i _ c h a n m = c l _ s e m_ mp _ d o c u me n t s = > c _ n a me _ k e y f .x _ v a l u e = i _ c h a v l .

E L S E .l _ c h a v l e x t = i _ c h a v l .

Page 22: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 22/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

2002 SAP AMERICA, INC. AND SAP AG

C AL L F U NC T I ON ' U PC _ C HA V L _ E X _ I N _ C ON VE R T 'E X P OR T I N G

i _ a r e a = i _ a r e ai _ c h a n m = i _ c h a n mi _ c h a v l e x t = l _ c h a v l e x t

I MP ORT I N Ge _ c h a v l i n t = x _ v a l u e " # E C DOM_ E QUA L

E X CE P T I ON Si n v a l i d _ f o r ma t = 1c h a n m_ n o t _ f o u n d = 2r f c _ e r r o r = 3f a i l e d = 4OT H E R S = 5 .

I F s y - s u b r c < > 0 .x _ s u b r c = 1 .l s _ me s g - ms g i d = s y - ms g i d . l s _ me s g - ms g t y = s y - ms g t y .l s _ me s g - ms g n o = s y - ms g n o . l s _ me s g - ms g v 1 = s y - ms g v 1 .l s _ me s g - ms g v 2 = s y - ms g v 2 . l s _ me s g - ms g v 3 = s y - ms g v 3 .l s _ me s g - ms g v 4 = s y - ms g v 4 .A PP END l s _ me s g T O x t _ me s g .

E NDI F . " s y - s u b r cE NDI F . " k e y f i g u r e

E L S E .* w e h a v e a v a r i a b l e

CA L L ME T HOD l r _ v a r i a b l e - > g e t _ v a l u eRE CE I V I NG

r t o _ v a l u e = l t o _ v a l u eE X CE P T I ON S

e r r o r = 1 .x _ s u b r c = s y - s u b r c .I F s y - s u b r c < > 0 .

l s _ me s g - ms g i d = s y - ms g i d . l s _ me s g - ms g t y = s y - ms g t y .l s _ me s g - ms g n o = s y - ms g n o . l s _ me s g - ms g v 1 = s y - ms g v 1 .l s _ me s g - ms g v 2 = s y - ms g v 2 . l s _ me s g - ms g v 3 = s y - ms g v 3 .l s _ me s g - ms g v 4 = s y - ms g v 4 .

A PP END l s _ me s g T O x t _ me s g .E X I T .

E NDI F . " s y - s u b r c

* t h e v a r i a b l e mu s t c o n t a i n a s i n g l e v a l u eDE S CRI B E T AB L E l t o _ v a l u e L I NE S l _ l i n e s .RE AD T AB L E l t o _ v a l u e I NDE X 1 I NT O l s _ v a l u e .

I F l _ l i n e s < > 1 OR NOT l s _ v a l u e - h i g h I S I N I T I A L .CL E A R l s _ me s g .l s _ me s g - ms g i d = ' UP P _ L B' . l s _ me s g - ms g t y = ' E ' .l s _ me s g - ms g n o = ' 0 7 5 ' . l s _ me s g - ms g v 1 = l _ v a r n m.A PP END l s _ me s g T O x t _ me s g .x _ s u b r c = 1 .E X I T .

E L S E .* s e t t h e v a l u e

x _ v a l u e = l s _ v a l u e - l o w.E NDI F .

E ND I F .E NDF ORM. " r e p l a c e _ v a r i a b l e

Page 23: Documents in SEM-BPS and BW-BPS

8/3/2019 Documents in SEM-BPS and BW-BPS

http://slidepdf.com/reader/full/documents-in-sem-bps-and-bw-bps 23/23

HOW TO … DOCUMENTS IN SEM-BPS AND BW-BPS

4.2.2 UPF_DOC_COPY_EXIT

F U N CT I ON U P F _ D OC _ C OP Y _ E X I T .* " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -* " * " L o k a l e Sc h n i t t s t e l l e :* " I MP ORT I NG

* " R EF E RE NC E( I _ A R EA ) T Y P E UP C_ Y _ A R EA* " R EF E RE NC E( I _ P L E V E L ) T Y P E U PC _ Y _ P L E VE L* " R E F ER EN CE ( I _ ME T H OD ) T Y P E U PC _ Y _ ME T H OD* " R EF E RE NC E( I _ P A RA M) T Y P E U PC_ Y _ P A RA M* " R E F ER EN CE ( I _ P A C K AGE ) T Y P E U PC _ Y _ P A C KA GE* " RE F ERE NCE ( I T _ E XI T P ) T Y PE UP F _ YT _ E XI T P* " R E F ER EN CE ( I T O_ C H AS E L ) T Y P E U P C_ Y T O _ C HA S E L* " R E F ER EN CE ( I T O_ C H A) T Y P E U P C_ Y T O _ C HA* " R EF E RE NC E( I T O_ K Y F ) T Y P E U PC_ Y T O_ K Y F* " E XP ORT I NG* " R E F ER EN CE ( E T _ ME S G) T Y P E U P C_ Y T _ ME S G* " CHA NGI NG* " R E F ER EN CE ( X T H _ D AT A ) T Y P E H AS H ED T A B L E* " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

E x i t .

E N D F U NC T I ON .