cancel
Showing results for 
Search instead for 
Did you mean: 

Storage of BW Master Data Documents

Former Member
0 Kudos
309

Hi,

What is the name of the database table where the BW Master Data Documents are stored? Furthermore, I need to be able to get the last changed date of the document in the database table.

I know that the Master Data Repository uses database table BWCONTMAST. But this table doesn't have a date.

I really need the date because I will be writing an ABAP program to delete old documents.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

there is not just one table for master data documents. All the tables related to master data documents start with RSOD* and end with *MA. May be that helps searching... You can find the creation date of a document in table RSODPHIOMA.

I do not recomend using the tables directly for ABAP. There is a function module available (RSOD_DOC_MAST_CHANGE) to create documents. You can use Function module SKWF_IOS_DELETE to remove the physical documents from the database.

Hope that helps

Stephan

Former Member
0 Kudos

THANK YOU SO MUCH... I've been looking for a function to delete and I couldn't find anything. Thanks for pointing me to SKWF_IOS_DELETE.

Do you have sample of using this function in ABAP code?

Thanks again!

Former Member
0 Kudos

Hi,

you need to code something like:

SELECT OBJECT_ID FROM RSODLOPRMA

WHERE ... (depends on your document names)

Fill internal table L_T_IOS of structure SKWF_IO in this select.

Then:

CALL FUNCTION 'SKWF_IOS_DELETE'

EXPORTING

X_DELETE_CHILDREN = 'X'

IMPORTING

ERROR = E_S_ERROR

TABLES

IOS = L_T_IOS

BAD_IOS = E_T_BAD_IOS.

If you have runtime problems because of two many documents, you can add IN BACKGROUND TASK after the CALL FUNCTION.

Does this help?

Regards

Stephan

Former Member
0 Kudos

My problem is filling internal table of type SKWF_IO. Structure SKWF_IO has 4 components: OBJTYPE, .INCLUDE, CLASS, and OBJID.

CLASS would be 'BW_LO_MAST'

OBJID would be the long alphanumeric

What goes in OBJTYPE and .INCLUDE?

I tried populating CLASS and OBJID and left OBJTYPE and .INCLUDE empty. The function suceeded with sy-subrc=0 but the document is still there.

Can you provide more details on populating the internal table of type SKWF_IO?

Thanks.

Former Member
0 Kudos

You do not need to populate .INCLUDE, put 'L' into OBJTYPE.

Former Member
0 Kudos

I hardcoded data in my ABAP program to see how the function works. But I haven't been successful. Here's my code:

-


DATA: mytab type SKWF_IO OCCURS 0 WITH HEADER LINE.

mytab-objtype = 'L'.

mytab-class = 'BW_LO_MAST'.

mytab-objid = '42C92336997D6DCDE100000096EB1F7E'.

CALL FUNCTION 'SKWF_IOS_DELETE'

EXPORTING

X_DELETE_CHILDREN = 'X'

  • IMPORTING

  • ERROR =

TABLES

IOS = mytab

  • BAD_IOS =

.

IF sy-subrc = 0.

write: / 'success'.

ENDIF.

-


I logged out of the system. Came back in and viewed the documents in RSA1. The document I'm trying to delete is still there.

Any suggestions?

Former Member
0 Kudos

Hi,

in your coding there is an APPEND MYTAB missing before the CALL FUNCTION.

Does this help?

Former Member
0 Kudos

Thanks, that did the trick.

I've found that I need to make 2 calls to the function. First time with the Logical Document information. And a secondtime with the Physical Document information.

Is it correct to make these 2 calls? Or is there a simpler way?

Thank you.

Former Member
0 Kudos

Hi,

as the logical and physical document have different object IDs, you indeed need to run the function module twice.

I have just checked the SAP Coding, there is another FM called SDOK_LOIOS_DELETE_WITH_PHIOS, may be that is more easy to use. I have never used it in a project, but a little test has shown that here the logical and the physical document are deleted. As input you need the object key of the logical document and the class (BW_LO_MAST for master data).

Regards

Stephan

Former Member
0 Kudos

Hello.

SDOK_LOIOS_DELETE_WITH_PHIOS works much better. Not only do I only have to make one function call, but the time to delete is much faster.

Thank you so much for all your help!

Answers (0)