cancel
Showing results for 
Search instead for 
Did you mean: 

Delete records in routine based on navigational attributes

Former Member
0 Kudos

Hello

In end routine to cube,I would like to delete my RESULT_PACKAGE where atleast one of my 4 navigational attributes TAB1, TAB2, TAB3 and TAB4 of infoobject ZPO_NUM are not blank.

eg., DELETE RESULT_PACKAGE where <TAB1> NE ' ' OR  <TAB2> NE '  ' OR <TAB3> NE ' '  OR <TAB4> NE ' '.

How do I refer to my navigational attribute in the routine in order for the above statement to work/?

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

we can delete by using P table of infoobject

in the end routine we have to lookup with masterdata of infoobject table with same infoobject of result package as a primary key we can write the coding.

for this we need create table type for infoobject and 4 attributes later declare ITAB for that and result package  and look up with primary key for that u can write coding.

Former Member
0 Kudos

Hi,


Suppose your infoobject is field1 and its attributes are tab1, tab2, tab3 and tab4

Data itab like table of /BI0/Mfield1.


Data wa like line of itab.


itab[] =  /BI0/Mfield1[].


Loop at result_package assigning <result_fields>


     Loop at itab into wa where field1 = <result_fields>-field1.

       If wa-tab1 NE ' ' OR  wa-tab2 NE '  ' OR wa-tab3 NE   ' '  OR wa-tab4 NE ' '.

       Delete <result_fields>.
       endif.
     endloop.
endloop.


replace /BI0/ with /BIC/ if your infoobject is customized one.

Pl try this and let me know. I didnt test this code.

Regards,

Mohammed.

Former Member
0 Kudos

Hi,

Please try below in end routine:

1.Create internal table and load the master data with the four attributes from M Table of ZPO_NUM (If the attributes are time independent use P table).

2. In Result Package Loop read th internal table data with InfoObject "ZPO_NUM"

3. If all the four fields are blank then delete the result package.

Thanks,

anshu_lilhori
Active Contributor
0 Kudos

Hi,

Please try the below code..Its a rough code and i have not tested it on my system.You may change the name of infoobject accordingly and its data type.

Also share the syntax error if this code gives and.Last but not the least check if this works in and give the desired output or not.

Types:Begin of Po_num,

      ZPo_num type,(give the data type of that infobject)

      tab1 type,

      tab2  type,

      tab3  type,

      tab4  type,

      OBJEVERS TYPE,

end of po_num.

data:itab type standard table of po_num,

    wa_itab type po_num.

SELECT /BIC/ZPO_NUM TAB1 TAB2 TAB3 TAB4 OBJVERS INTO TABLE ITAB

FOR ALL ENTRIES IN RESULT_PACKAGE

WHERE /BIC/ZPO-NUM = RESULT_PACKAGE-/BIC/ZPO_NUM AND

OBJVERS = 'A'

AND TAB1 = '' AND TAB2 = '' AND TAB3 = '' AND TAB4 = ''.

      LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS> .

      READ TABLE ITAB INTO WA_IAB WITH KEY

      /BIC/ZPO-NUM = <RESULT_FIELDS>-/BIC/ZPO_NUM.

IF SY-SUBRC = 0.

DELETE RESULT_PACKAGE.

ENDIF.

ENDLOOP.

Hope this helps.

Regards,

AL

former_member182470
Active Contributor
0 Kudos

Hello Anshu/Arthi,

She wants to handle Nav attrs in her code. So she should use X (Time Independent Nav Attr table) and Y( Time Dependent Nav Attr table), but not P tables.

She just need to use X/Y tables in your code. It may work..

Regards,

Suman

anshu_lilhori
Active Contributor
0 Kudos

Hi Suman,

If you look closely into the X table of any infoobject then you will find  it contains the SID value and not the values of those attributes.

So whenever we need to do a lookup on master data table then it should be P table of that infoobject which has all the attributes values stored in it.

Arthi,Please add the bold texts in select statement.Somehow unable to edit my reply.

SELECT /BIC/ZPO_NUM TAB1 TAB2 TAB3 TAB4 OBJVERS from /BIC/PZPO_NUM INTO TABLE ITAB

Regards,

AL


ravi_chandra3
Active Contributor
0 Kudos

Hi

The navigation attribute is present in the /bic/x<IO> ,

Load the data by using the select statement. and then compare the data in the loop at result_package.

I am not sure , whether it will work or not.

Please once check it and let me know..

RamanKorrapati
Active Contributor
0 Kudos

Hi,

If possible please check at DTP filters. whether if you able to see nav attributes to do filter selection.

if possible then you exclude them which are not blank.

Thanks