cancel
Showing results for 
Search instead for 
Did you mean: 

Copy Filter Table Uja_Filter

michele_medaglia5
Active Participant
0 Kudos

Hi Bpc Friends

I have created a filter in the EPM-add in and I have inserted in the selection of a data package.

I have copied this filter in the table in BW so another user can run the same package but he got an error message

<?XML VERSION="1.0" ENCODING="UTF-16"?><ASX:ABAP XMLNS:ASX="HTTP://WWW.SAP.COM/ABAPXML" VERSION="1.0"><ASX:VALUES><ROOT><APPSET_ID>PRESS_CONSOL</APPSET_ID><TYPE>M</TYPE><USER_ID>AXSTUART</USER_ID><APPLICATION_ID>REPORTING</APPLICATION_ID><DATASET_ID>TIME</DATASET_ID><NAME>BUD_FCST_DRS</NAME><T_SEL_ATTR><UJ0_S_SEL><DIMENSION>TIME</DIMENSION><ATTRIBUTE>BUD_FCST_DRS</ATTRIBUTE><SIGN>I</SIGN><OPTION>EQ</OPTION><LOW>IN_BPF</LOW><HIGH/></UJ0_S_SEL></T_SEL_ATTR><T_SEL_ATTR_LONG/><T_SEL_HIER/><F_OR_MODE>X</F_OR_MODE><DATEFROM>0000-00-00</DATEFROM><DATETO>0000-00-00</DATETO></ROOT></ASX:VALUES></ASX:ABAP>

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Are you sure that you copied full text in CONTENT? How you perform copy?

michele_medaglia5
Active Participant
0 Kudos

yes because I did my colleague running an ABAP transaction

Answers (2)

Answers (2)

former_member186338
Active Contributor
0 Kudos

Sorry, but it's better to compare the same filters (same selection)!

former_member186338
Active Contributor

How do you perform copy?

michele_medaglia5
Active Participant
0 Kudos

yes I compared the same filter and I copy using /h with abap debugger

I understood the problem and it is due to lower case and upper case

the first one doesn't work, the second one yes

I tried to change manually to lower case but when I save the string will be saved as upper case

how could I fix that?

<?XML VERSION="1.0" ENCODING="UTF-16"?><ASX:ABAP XMLNS:ASX="HTTP://WWW.SAP.COM/ABAPXML" VERSION="1.0"><ASX:VALUES><ROOT><APPSET_ID>PRESS_CONSOL</APPSET_ID><TYPE>M</TYPE><USER_ID>BPCSIT1</USER_ID><APPLICATION_ID>REPORTING</APPLICATION_ID><DATASET_ID>TIME</DATASET_ID><NAME>BUD_FCST_DRS</NAME><T_SEL_ATTR><UJ0_S_SEL><DIMENSION>TIME</DIMENSION><ATTRIBUTE>BUD_FCST_DRS</ATTRIBUTE><SIGN>I</SIGN><OPTION>EQ</OPTION><LOW>IN_BPF</LOW><HIGH/></UJ0_S_SEL></T_SEL_ATTR><T_SEL_ATTR_LONG/><T_SEL_HIER/><F_OR_MODE>X</F_OR_MODE><DATEFROM>0000-00-00</DATEFROM><DATETO>0000-00-00</DATETO></ROOT></ASX:VALUES></ASX:ABAP>

?xml version="1.0" encoding="utf-16"?><asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"><asx:values><ROOT><APPSET_ID>PRESS_CONSOL</APPSET_ID><TYPE>M</TYPE><USER_ID>MMEDAGLIA</USER_ID><APPLICATION_ID>Reporting</APPLICATION_ID><DATASET_ID>TIME</DATASET_ID><NAME>BUD_FCST_DRS</NAME><T_SEL_ATTR><UJ0_S_SEL><DIMENSION>TIME</DIMENSION><ATTRIBUTE>BUD_FCST_DRS</ATTRIBUTE><SIGN>I</SIGN><OPTION>EQ</OPTION><LOW>IN_BPF</LOW><HIGH/></UJ0_S_SEL></T_SEL_ATTR><T_SEL_ATTR_LONG/><T_SEL_HIER/><F_OR_MODE>X</F_OR_MODE><DATEFROM>0000-00-00</DATEFROM><DATETO>0000-00-00</DATETO></ROOT></asx:values></asx:abap>

former_member186338
Active Contributor
0 Kudos

Use simple ABAP code to copy record!

michele_medaglia5
Active Participant
0 Kudos

?xml version="1.0" encoding="utf-16"?><asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"><asx:values><ROOT><APPSET_ID>PRESS_CONSOL</APPSET_ID><TYPE>M</TYPE><USER_ID>MMEDAGLIA</USER_ID><APPLICATION_ID>Reporting</APPLICATION_ID><DATASET_ID>TIME</DATASET_ID><NAME>BUD_FCST_DRS</NAME><T_SEL_ATTR><UJ0_S_SEL><DIMENSION>TIME</DIMENSION><ATTRIBUTE>BUD_FCST_DRS</ATTRIBUTE><SIGN>I</SIGN><OPTION>EQ</OPTION><LOW>IN_BPF</LOW><HIGH/></UJ0_S_SEL></T_SEL_ATTR><T_SEL_ATTR_LONG/><T_SEL_HIER/><F_OR_MODE>X</F_OR_MODE><DATEFROM>0000-00-00</DATEFROM><DATETO>0000-00-00</DATETO></ROOT></asx:values></asx:abap>

michele_medaglia5
Active Participant
0 Kudos

I used the following

former_member186338
Active Contributor

Just write Z program in ABAP to copy record!

michele_medaglia5
Active Participant
0 Kudos

thanks Vadim

I am not an ABAP person.

Could you please drive me?

michele_medaglia5
Active Participant
0 Kudos

Hi Vadim

I ram SE38 and I got this point.

Now what should I have to write?

former_member186338
Active Contributor

Good idea to start learning abap! Unfortunately I can't provide online training 🙂

Start with some simple examples, try to read data from this table!

michele_medaglia5
Active Participant
0 Kudos

don't worry, I will leave it, is not my job

Thanks

former_member186338
Active Contributor

Just start with something like:

REPORT ZMICHELE.
DATA: wa TYPE uja_filter.
SELECT * FROM UJA_FILTER INTO CORRESPONDING FIELDS OF wa.
 WRITE: / wa-mandt, wa-appset_id, wa-type, wa-user_id, 
wa-application_id, wa-dataset_id, wa-name, wa-content, wa-f_or_mode, 
wa-datefrom, wa-dateto.
ENDSELECT.

You will see the records of table!

former_member186338
Active Contributor

Sample of record copy with user name changed:

DATA: wa TYPE uja_filter.
" Select source record with user V.KALININ, filter name NODY etc...
SELECT * FROM UJA_FILTER INTO CORRESPONDING FIELDS OF wa WHERE APPSET_ID = 'SIM' AND TYPE = 'M' AND USER_ID = 'V.KALININ' AND APPLICATION_ID = 'INFILE' AND DATASET_ID = 'PERIODS' AND NAME = 'NODY'.
ENDSELECT.
WRITE: / wa-mandt, wa-appset_id, wa-type, wa-user_id, wa-application_id, wa-dataset_id, wa-name, wa-content, wa-f_or_mode, wa-datefrom, wa-dateto.
" Change user name in USER_ID and CONTENT to V.KRIGER
wa-user_id = 'V.KRIGER'.
REPLACE ALL OCCURRENCES OF 'V.KALININ' IN wa-content WITH 'V.KRIGER'.
WRITE: / wa-mandt, wa-appset_id, wa-type, wa-user_id, wa-application_id, wa-dataset_id, wa-name, wa-content, wa-f_or_mode, wa-datefrom, wa-dateto.
" Insert new record for V.KRIGER
INSERT UJA_FILTER FROM wa.
" Show result - all records
CLEAR wa.
SELECT * FROM UJA_FILTER INTO CORRESPONDING FIELDS OF wa.
  WRITE: / wa-mandt, wa-appset_id, wa-type, wa-user_id, wa-application_id, wa-dataset_id, wa-name, wa-content, wa-f_or_mode, wa-datefrom, wa-dateto.
ENDSELECT.
former_member186338
Active Contributor
0 Kudos

Look on the sample CONTENT field in my system (I have split it into lines):

<?xml version="1.0" encoding="utf-16"?>
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ROOT>
<APPSET_ID>SIM</APPSET_ID>
<TYPE>M</TYPE>
<USER_ID>V.KALININ</USER_ID>
<APPLICATION_ID>ST123</APPLICATION_ID>
<DATASET_ID>USER22</DATASET_ID>
<NAME>ttt</NAME>
<T_SEL_ATTR>
<UJ0_S_SEL>
<DIMENSION>USER22</DIMENSION>
<ATTRIBUTE>CALC</ATTRIBUTE>
<SIGN>I</SIGN>
<OPTION>EQ</OPTION><LOW>Y</LOW><HIGH/>
</UJ0_S_SEL>
</T_SEL_ATTR>
<T_SEL_ATTR_LONG/>
<T_SEL_HIER/>
<F_OR_MODE>X</F_OR_MODE>
<DATEFROM>0000-00-00</DATEFROM><DATETO>0000-00-00</DATETO>
</ROOT>
</asx:values></asx:abap>

User is also present here!

michele_medaglia5
Active Participant
0 Kudos

yes, it looks the same like your code and initially I left my user id but it didn't wrong, later I changed with the user that is going to run it AXSTUART (as you can see below) but he got error again

<?XML VERSION="1.0" ENCODING="UTF-16"?>

<ASX:ABAP XMLNS:ASX="HTTP://WWW.SAP.COM/ABAPXML" VERSION="1.0">

<ASX:VALUES>

<ROOT>

<APPSET_ID>PRESS_CONSOL</APPSET_ID>

<TYPE>M</TYPE>

<USER_ID>AXSTUART</USER_ID>

<APPLICATION_ID>REPORTING</APPLICATION_ID>

<DATASET_ID>TIME</DATASET_ID>

<NAME>BUD_FCST_DRS</NAME>

<T_SEL_ATTR>

<UJ0_S_SEL>

<DIMENSION>TIME</DIMENSION>

<ATTRIBUTE>BUD_FCST_DRS</ATTRIBUTE>

<SIGN>I</SIGN>

<OPTION>EQ</OPTION><LOW>IN_BPF</LOW><HIGH/>

</UJ0_S_SEL>

</T_SEL_ATTR>

<T_SEL_ATTR_LONG/>

<T_SEL_HIER/>

<F_OR_MODE>X</F_OR_MODE>

<DATEFROM>0000-00-00</DATEFROM><DATETO>0000-00-00</DATETO>

</ROOT>

</ASX:VALUES></ASX:ABAP>

former_member186338
Active Contributor
0 Kudos

Ask the user to create the same filter, but with different name!

Compare records!

Test DM package with the new filter name (ask user to run it)

former_member186338
Active Contributor

P.S. Can this user select the BUD_FCST_DRS filter manually?

michele_medaglia5
Active Participant
0 Kudos

no, he can't

former_member186338
Active Contributor

What about creating filter with other name himself?

michele_medaglia5
Active Participant
0 Kudos

IT WORKS but not with the same name

former_member186338
Active Contributor
0 Kudos

Ups, not clear...

What "WORKS"

former_member186338
Active Contributor

What do you see if you compare records in the table?

michele_medaglia5
Active Participant
0 Kudos

I FOUND the problem, when I copy the filter even if the some part of the string is lowercase when I save it will be changed in upper case

How could I fix that?

<?XML VERSION="1.0" ENCODING="UTF-16"?><ASX:ABAP XMLNS:ASX="HTTP://WWW.SAP.COM/ABAPXML" VERSION="1.0"><ASX:VALUES><ROOT><APPSET_ID>PRESS_CONSOL</APPSET_ID><TYPE>M</TYPE><USER_ID>BPCSIT1</USER_ID><APPLICATION_ID>REPORTING</APPLICATION_ID><DATASET_ID>TIME</DATASET_ID><NAME>BUD_FCST_DRS</NAME><T_SEL_ATTR><UJ0_S_SEL><DIMENSION>TIME</DIMENSION><ATTRIBUTE>BUD_FCST_DRS</ATTRIBUTE><SIGN>I</SIGN><OPTION>EQ</OPTION><LOW>IN_BPF</LOW><HIGH/></UJ0_S_SEL></T_SEL_ATTR><T_SEL_ATTR_LONG/><T_SEL_HIER/><F_OR_MODE>X</F_OR_MODE><DATEFROM>0000-00-00</DATEFROM><DATETO>0000-00-00</DATETO></ROOT></ASX:VALUES></ASX:ABAP>

?xml version="1.0" encoding="utf-16"?><asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"><asx:values><ROOT><APPSET_ID>PRESS_CONSOL</APPSET_ID><TYPE>M</TYPE><USER_ID>MMEDAGLIA</USER_ID><APPLICATION_ID>Reporting</APPLICATION_ID><DATASET_ID>TIME</DATASET_ID><NAME>BUD_FCST_DRS</NAME><T_SEL_ATTR><UJ0_S_SEL><DIMENSION>TIME</DIMENSION><ATTRIBUTE>BUD_FCST_DRS</ATTRIBUTE><SIGN>I</SIGN><OPTION>EQ</OPTION><LOW>IN_BPF</LOW><HIGH/></UJ0_S_SEL></T_SEL_ATTR><T_SEL_ATTR_LONG/><T_SEL_HIER/><F_OR_MODE>X</F_OR_MODE><DATEFROM>0000-00-00</DATEFROM><DATETO>0000-00-00</DATETO></ROOT></asx:values></asx:abap>