Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Reg Variant Tracking

karthik_snair
Participant
0 Likes
3,818

Hi All,

i need to create a report to track all the variants  all the objects.

Means in the selection screen if the user giving the report name , need to display all the variant details with content.This thing i know.

table VARID to get the variant name

FM RS_VARIANT_CONTENTS to get the variant content details

Now i want similarly for Function modules as well.

Please help me to track where the variant details of FM gets stored and with content.

I think only for FM and report will have variant concept.If not please let me know for what and all other objects can have the variant and how to track this.

Please help me out in this.

Thanks in Advance.

Karthik.S

1 ACCEPTED SOLUTION
Read only

karthik_snair
Participant
0 Likes
3,676

Hi Team,

i have one doubt, See i have a variant for a program.The same variant i am changing and saving under same variant name.So now i want to track.Who changed the old data in the same variant and what he has changed.I need user details as well as old data and new data.

Please help me out to trace this.

Thanks,

Karthik.S

31 REPLIES 31
Read only

Former Member
0 Likes
3,676

Hi,

You can check this function module. /OSP/REPORT_GET_VARIANT_DETAIL

call function '/OSP/REPORT_GET_VARIANT_DETAIL'
       exporting
         iv_report_name = report
         iv_variant     = variant_name
         iv_sapid       = sapid
       importing
         et_return      = et_return
         et_valuetab    = lt_valuetab.

Thanks,

Kiran

Read only

0 Likes
3,676

Hi Kiran,

thanks for the reply.

But see i want to know

for the Function Modules's where the test data directory content is getting stored??

Read only

0 Likes
3,676

did you try with above mentioned statement..table for function module variant is EUFUNC

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
3,676

I just debugged for function module and this is how SAP fetches it. table highlighted in bold will have variant detail

Check include LSEUJFDB form DB_IMPORT_DATADIR

d102n_exportkey-area = p_file.  ---------------------> FM name

d102n_exportkey-progid = p_fname.----------------> Pass FM name

d102n_exportkey-dataid = dataid. --------------------> 999

IF dir_flag IS INITIAL.

  CATCH SYSTEM-EXCEPTIONS conne_import_wrong_comp_type = 1.

    IMPORT te_datadir

           fdesc_copy

           struc_info_table_copy

           g_no_save TO l_no_save

           d102_fname FROM DATABASE eufunc(fl) ID d102n_exportkey.

Read only

0 Likes
3,676

Hi nabheet,

See i want to see and fetch all variant list and the content from some table. by passing the function module name.

How do i do?? any idea??

Please let me know.

Read only

0 Likes
3,676

If you use the above mention code in your program or check table EUFUNC it will give you the list of variants for a particular function module. Do one thing put a break point at the statement mentioned above and goto Se37 execute any FM and choose variant you will see how SAP standard is doing it.

Read only

0 Likes
3,676

See, i have checked the table EUFUNC. from that i got the variant details.Now based on the data record no i need to get the content of each variant.

See in that standard program its first exporting and then importing.let me explore more on that too.

Thank you..

Read only

karthik_snair
Participant
0 Likes
3,676

Hi All,

i want to know where in which table exactly the test data content(Data's) of each test data for a function module.

please help me to find this.

Read only

0 Likes
3,676

SAP is using SFCS_FA_PARAMETER_GET to get individual parameter values. Basically if you check for each function module a program is generated in the background by concatenating function module name and "=FT". this is where it reads data from cluster tables for test data.

You will have to do more research on this..

Read only

0 Likes
3,676

Let me also dig more:)

Read only

0 Likes
3,676

This message was moderated.

Read only

0 Likes
3,676

One more doubt,

can we use import directly with out export statement???

See below is my coding.

select single * from tfdir where funcname = l_fmname.

     call function 'FUNCTION_INCLUDE_SPLIT'

       exporting

         program   = tfdir-pname

       importing

         namespace = t_rs38l-namespace

         group     = t_rs38l-str_area

       exceptions

         others    = 6.

     if sy-subrc ne 0.

       message s110(fl) with l_fmname.

       leave.

     endif.

     concatenate t_rs38l-namespace t_rs38l-str_area into t_rs38l-area.

     t_testprog = l_fmname.

     translate t_testprog using ' ='.

     t_testprog+30 = 'FT'.

     t_d102n_exportkey-area = t_rs38l-area.

     t_d102n_exportkey-progid = l_fmname.

     t_d102n_exportkey-dataid = '999'.

     catch system-exceptions conne_import_wrong_comp_type = 1.

       import t_datadir

              t_fdesc_copy

              struc_info_table_copy

              l_no_save to l_no_saveto

              d102_fname from database eufunc(fl) id t_d102n_exportkey.

i tried this way as well

CATCH SYSTEM-EXCEPTIONS conne_import_wrong_comp_type = 1.

       IMPORT t_datadir

              FROM DATABASE eufunc(fl) ID d102n_exportkey.

     ENDCATCH.

But i am not getting the records in the table t_datadir.

Please help me out so solve this.

The step is executing with out any error but no records..

The requirement is that i need to fetch the test data in human readable form (not in the form of cluster directly as from enfunc).

Thanks,

Karthik.S

Read only

0 Likes
3,676

In area please pass the function group name.

Read only

0 Likes
3,676

i am passing function group name only....

Read only

0 Likes
3,676

Hi Karthik

I have checked the below mentioned code. Its returning me the detail of test variants.   Test data also checking

DATA: l_no_save TYPE c.

DATA : BEGIN OF te_datadir OCCURS 10,

         dataid LIKE eufunc-nummer,    "Schlüsselnr. für Testdatenimp.

         stepid(3),                    "PBO/PAI-Eintrag

         seqid  LIKE eufunc-seqid,

         datum LIKE sy-datum,

         uzeit LIKE sy-uzeit,

         title(40),

       END OF te_datadir.

TYPE-POOLS: suni, nf2ty, setst, swbse, seoc.

DATA: struc_info_table_entry TYPE nf2ty_struc_info_table_entry,

      struc_info_table TYPE nf2ty_struc_info_table,

      struc_info_table_copy TYPE nf2ty_struc_info_table.

DATA : BEGIN OF fdesc OCCURS 10,

         name(30),                     "Feldname

         table(40),                    "Tabellenname

         type(1),                      "Datentyp

         length(5),                    "Länge

         ilength(5),                   "Eingabelänge

         hlength TYPE p,               "Eingabelänge

         ftype(3),                     "Typ fdt_...

                                       "I IMPORT

                                       "E EXPORT

                                       "C CHANGING

                                       "S STRUCTURE

                                       "Y TYPE

                                       "T TABLE

         number TYPE i,                "Referenz, wessen Struktur

       END OF fdesc.

DATA: BEGIN OF fdesc_copy OCCURS 10,

        line LIKE fdesc,

      END OF fdesc_copy.

DATA: d102_fname LIKE rs38l-name.

REFRESH te_datadir.

REFRESH fdesc_copy.

CLEAR struc_info_table_copy.

CLEAR d102_fname.

DATA : d102n_exportkey LIKE functdir.

CLEAR  d102n_exportkey.

d102n_exportkey-area = 'SPO1'.                  "-- Function Group --"

d102n_exportkey-progid = 'POPUP_TO_CONFIRM'.    "-- Function Module --"

d102n_exportkey-dataid = '999'.

CATCH SYSTEM-EXCEPTIONS conne_import_wrong_comp_type = 1.

  IMPORT te_datadir

         fdesc_copy

         struc_info_table_copy

         g_no_save TO l_no_save

         d102_fname FROM DATABASE eufunc(fl) ID d102n_exportkey.

ENDCATCH.

BREAK-POINT.

Read only

0 Likes
3,676

Yes its working...

Now i need the content of the test data he has selected....

Thanks in advance...

Read only

Former Member
0 Likes
3,676

This message was moderated.

Read only

karthik_snair
Participant
0 Likes
3,677

Hi Team,

i have one doubt, See i have a variant for a program.The same variant i am changing and saving under same variant name.So now i want to track.Who changed the old data in the same variant and what he has changed.I need user details as well as old data and new data.

Please help me out to trace this.

Thanks,

Karthik.S

Read only

0 Likes
3,676

This message was moderated.

Read only

0 Likes
3,676

Hi,

Currently I am checking your issue, However,please find the FM to get the report details of variant RS_VARIANT_INFO

Thanks,

Kiran

Read only

0 Likes
3,676

Hi Karthik-

Check below tables which may help you:

VARI - Will store different versions.

VARIT - For Variant Texts

VARID - Variant Directory

-Venkat

Read only

0 Likes
3,676

Hi Venkat,

in VARI table we have field called CLUSTD where we have content of the table.But its of type RAW.

So how can i convert so that we can see the data in understandable format.

Please help me out.

Read only

0 Likes
3,676

Hi,

Same like is there any way to trace the test data changes for FUNCTION Module.

I want who created test data , if some one modified the same ,, i need those info and old data + new modified data.

I need all modification history details for a test data of a Function Module.

Help required.

Read only

0 Likes
3,676

Hi Karthik,

I have tried my best but unable to found the history table or FM to store the change log of report variants. In fact all variant tables are start with VAR* only.

I have checked the some reports and no use of it.

RSADJUSTVARITABLES           Reconcile VARIT, VARID, VARI, and VARIS
RSDBSPVD                     RSDBRUNT Help: Variants and Dynamic Selections

VARID: You will get the only latest details of the variant changes.

I guess no history table available to track the changes. better to think other alternate.

Thanks,

Kiran

Read only

0 Likes
3,676

This message was moderated.

Read only

0 Likes
3,676

Hi Karthik

Can you please summarize what all is pending and you are looking for?

Nabheet

Read only

0 Likes
3,676

Hi Nabheet.

Pending Requirement,

1) Need to fetch all the changes happened to a variant of a report program.

Ex. Var1 is a variant for a report and its created by me yesterday. Today i have modified , and today evening some one else modified the same variant VAR1 again.

So i want to trace what modification he has done??

means User delails + date + time + old value + new value.

Now i am getting who created, who last modified and the latest variant values.

2)Need to fetch all the changes happened to a Test Data of a FM.

   Same like above.

need to fetch all the details like user name those who has created and who has changed+date+time+old value+new value

But as of now for FM's i am not able to fetch anything..not even the User name who created it.

i am getting the test data list as per the code u suggested,But actually that is not the requirement.

Read only

0 Likes
3,676

Hi Karthik,

You can track the changes in case of FM variants  by using the table EUFUNC. The table will have the field called NUMMER to get the history log.

I am not getting such type of instance for report variants.

Thanks,

Kiran

Read only

0 Likes
3,676

Hi Karthik

You will have to take one step at a time.

Function module

RS_TESTDATA_GET  eturns you the author, creation date and time details etc.

RS_TESTDATA_DIRECTORY_GET return all test data varaints

SFCS_FA_PARAMETERS_GET_TABLE-- For each test data found in above FM use this FM(or a zcopy as per your need) CONTAINER will return you the parameter and its values.

Nabheet

Read only

0 Likes
3,676

Hi Nabheet,

i tried the FM RS_TESTDATA_GET , here i am passing the function module name and group but its not returning the author, creation date and time details etc.

Please check this out .

Karthik.S

Read only

0 Likes
3,676

plus you have to pass in nummer table also the values.