cancel
Showing results for 
Search instead for 
Did you mean: 

Update Routine ABAP question

Former Member
0 Kudos

Hi,

I am updating data between two ODS objects using some update routines. I would like to write the following routine (in pseudo code):

++++++++++++++++++++++++++++++++++++++++++++++++++++

Check if the characteristic i am updating is not null

IF COMM_STRUCTURE-field1 = 'value1' AND

COMM_STRUCTURE-field2 = 'value2'.

RESULT COMM_STRUCTURE-field3.

ELSE.

Don't update anything

END IF

+++++++++++++++++++++++++++++++++++++++++++++++++++

My questions:

1. How i tell the routine not to update anything (as specified in the pseudo code)?

2. How i can check that the characteristic i woul like to update is not null?

3. What is the preferred debug method in case i do not use the PSA?

BR,

Xibi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

1. How i tell the routine not to update anything (as specified in the pseudo code)?

set the returncode to a value <> 0.

2. How i can check that the characteristic i woul like to update is not null?

if not comm_structure-<fieldname> is initial.

3. What is the preferred debug method in case i do not use the PSA?

Without psa, you need to add a endless loop:

statics: st_flag type c value '0'.

while st_flag = '0'.

break-point.

endwhile.

Hope this helps!

regards

Siggi

Former Member
0 Kudos

Thanks Siggi for your prompt and helpful answer. There are however some fundamental things which are not fully clear to me (BTW, where i can find some good documentation on ABAP for BW??):

> Hi,

>

> 1. How i tell the routine not to update anything (as

> specified in the pseudo code)?

>

> set the returncode to a value <> 0.

I wrote the following:

returncode = 1.

Consequently the updated failed. Maybe i am doing something wrong but my intention is not to have the whole thing fail, but rather skip the update for some records.

> 2. How i can check that the characteristic i woul

> like to update is not null?

>

> if not comm_structure-<fieldname> is initial.

The problem is that the characteristic i am trying to update is not contained in the source ODS but only in the target one. Will "if not comm_structure-<fieldname> is initial" still work in this case?

>

> 3. What is the preferred debug method in case i do

> not use the PSA?

>

> Without psa, you need to add a endless loop:

> statics: st_flag type c value '0'.

>

> while st_flag = '0'.

> break-point.

> endwhile.

>

>

> Hope this helps!

>

> regards

>

> Siggi

0 Kudos

hi,

1. check http://help.sap.com/saphelp_nw04s/helpdata/en/0d/54a2a4705c3c4d9a3726773d741392/frameset.htm

http://help.sap.com/saphelp_nw04s/helpdata/en/36/57f941e6cbf941b69a2ab8dcf2f85e/frameset.htm

2. as far as the infoobject included in the communication structure (maintain infosource), you can check the initial.

hope this helps.

Former Member
0 Kudos

Thanks AHP.

The charactristic i am updating doesn't exist in the source ODS (just in the target).

Can you recommend on a way to check if that characteristic value is empty for each record i ant to update, such us in pseudocode:

If characteristic value is empty

Update

Else

Do nothing

End If

Many thanks,

Xibi

Former Member
0 Kudos

Hi,

if you want to check the value of the target ods, you need to select the record firstly into a work area, then you can do the check with: if wa_target-<fieldname> is initial. or if not wa_target-<fieldname> is initial.

Siggi

Answers (0)