Application Development 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: 

Dynamic Selection

Former Member
0 Kudos
431

Hi all,

I've been ask to modify the program RFDOPR10 (Customer open items analysis. the request consist on adding some fields in the dynamic selection, so they can select the data base on this fields.

How can I modify the dynamic selection button, so I can display my own fields.

Thanks in advanced,

Fidel

1 ACCEPTED SOLUTION

former_member181966
Active Contributor
0 Kudos
171
13 REPLIES 13

former_member181966
Active Contributor
0 Kudos
172

0 Kudos
171

Hi khan,

What I really want to know is how in a dynamic selection button can I create my own folder, that contain in itself a list of fields that I choose to display there.

if you can see the report that I mention you will see the button and the folders, how can I add my own folder in that report.

Regards,

Fidel

0 Kudos
171

hi

try like this

DATA: BEGIN OF INCTABL OCCURS 10,

LINE(72),

END OF INCTABL.

INCTABL-LINE = 'program zdynpro.'. APPEND INCTABL.

INCTABL-LINE = 'parameter: p_vbeln like vbap-vbeln.'. APPEND INCTABL.

INSERT REPORT 'zdynpro'(001) FROM INCTABL.

SUBMIT ZDYNPRO.

regards

kishore

0 Kudos
171

Hi,

Please also note that you can only add a folder for a table that is defined in logical database DDF as a dynamic selections table. See include program DBDDFSEL:

SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE KNA1.

If you want to add your own folder for a table that is not pre-defined in the logical database selections as dynamic, then you will probably need to create a copy of the logical database and modify it to fit your needs. Example: Add the banks table via:

SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE KNBK.

You will still need to modify the selection views (of your copy of DDF) so that your new table appears in the dynamic selections at runtime. Note also that the program using the logical database must also reference the new table (e.g. add KNBK to the TABLES declarations).

I only tried this briefly, so maybe someone can show that it is possible to add a folder for a new table such as KNBK without making a copy of DDF.

Regards,

James Gaddis

0 Kudos
171

Hi guys,

You have put me in the right track, I have done wat you have describe James, but when I try to activate the include DBZDDFSEL whit the new table in it, it gives me an error that says the ZTable is not part of the logical data base.

in the logical data base builder I added the ZTABLE using the suboject STRUCTURE and now the table appears when I create the selection view but still gives me the same error.

What can I do?

Regards,

Fidel

0 Kudos
171

You need to add the ZTable to your table declarations in SAPDBZDDF. Then you will get an error that says, "The form "PUT_ZTable" does not exist. To eliminate this error you need to add a FORM...ENDFORM in SAPDBZDDF (search for PUT_KNA1 and add your new form near form put_kna1). If you want the ZTable branch of logical database ZDDF to actually select data, then you will need to code this as well (refer to the code in the other "put" forms for an example of what sort of code is needed).

One other thing that I did not mention before is that you will probably need to declare two data objects for the new table. Find KNA1_WHERE in SAPDBZDDF for the location to add the new declaration. Example:

DATA: KNBK_WHERE LIKE RSDSWHERE OCCURS 10,           "JRG
      KNBK_FIELDS LIKE RSFS_STRUC OCCURS 10.         "JRG

Of course, you will be using your Ztable.

Then if you find the function call for RS_REFRESH_FROM_DYNAMICAL_SEL, you will see some macro code just before the function call. Example:

 INIT_WHERE: KNKA, KNKK.              " wernermar
  INIT_FIELDS: KNKA, KNKK.             " wernermar

You will need to add your own INIT_WHERE and INIT_FIELDS statements for the Ztable. There is also a place in form LDB_PROCESS_INIT where the KNA1_WHERE and KNA1_FIELDS are refreshed. You should add a refresh for your own _WHERE and _FIELDS itabs too.

Whew!! Sounds pretty complicated, huh? I may have missed some steps, so double-check everything. I think this is a good start though.

Let me know how it works out. I tried this stuff using table KNBK but did not really try out a Ztable. Should be an interesting task for you.

FYI: I made a quick change to the SAPDBZDDF form PUT_KNC1 and added KNC1 as a dynamic selection table. Here is what I did to in order to get the dynamic KNC1 selections to work:

FORM PUT_KNC1.
...

* Add a small dynamic select stmt to read KNC1
  select (KNC1_FIELDS) into corresponding fields of knc1
          from KNC1 where kunnr = save_kunnr
                      and (KNC1_WHERE).
  endselect.
  if sy-subrc ne 0.
* Reject the record if it was not found
    reject.
  endif.
  
  ACCESS_BUFFER_2 KNC1 KUNNR BUKRS.

ENDFORM.

Best Regards,

James Gaddis

Message was edited by: James Gaddis

0 Kudos
171

Hi James,

I really appreciate your help, thank u so much, but I have one last question if you may. Do I have to declare de table in the structure tab of the logical database as a node?, if so, then I have another question, the name of the table (actually is an structure) does not fit in the node's name field, the structures name is of the format /ccsat/co_venta/zclientesventas, this table belongs to an application develop in abap in Spain ( SIMAUTO), and because of this long name I can't choose the radiobutton database table at the node type option.

Should I choose the dictionary type radiobutton since is a structure and not a table?

I know I might be asking to much, but if you can answer this question I will be very grateful.

Thanks so much,

Fidel Peralta.

0 Kudos
171

It appears that SAP does not support (yet?) long namespaces in the logical database node creation. If you press the "Other node types" button, you will see that a Type Group type (DataType radiobutton) or a dynamic type can be used as a node. The DataType radiobutton creates a node which does not support dynamic selections, so this one does not help you. The dynamic type also will not be of use because you are required to enter the possible types (/ccsat/co_venta/zclientesventas in your case) in a field that is also too short to hold the name of your structure. I did not search for any Notes that address this problem, so you may want to check OSS first to see if there is a fix to allow long namespaces when creating a logical database node. Assuming there is no existing fix in OSS, you may want to consider opening this as a customer message.

One other thing that I can think of for you to try is this: Create a copy of the structure /ccsat/co_venta/zclientesventas with a smaller name. Use this structure as your Node name and then select from /ccsat/co_venta/zclientesventas in your PUT subroutine. Some moves between the two structures will be required.

Let me know how it goes.

- James Gaddis

0 Kudos
171

Thank u so much James, I decided to use the table KNVV which is the table where the structure that I mention saves the data. now is giving me an error that says

"Programa SAPDBZDDF

Field "CURSOR-KNVV" is unknown. It is neither in one of the specified

tables nor defined by a "DATA" statement."

and it points to the code

access_buffer_2 knvv kunnr bukrs.

If you don't know the answer in doesn't matter, I'll figure it out, you have done so much for me man, thanks a lot.

If I could award you more points I would.

Thanks and Regards,

Fidel.

0 Kudos
171

Fidel,

Add KNVV to the tables declarations in SAPDBZDDF. this will eliminate the first syntax error. Then you will get an error about the missing PUT_KNVV subroutine. Add the PUT_KNVV subroutine (near the other PUT_ subroutines) and you should be able to activate.

Cheers,

James G.

0 Kudos
171

I have already done that. apparently the table kunnr needs to have the field bukrs for the access_buffer_2 to work. if the code of the form put_knvv needs that part then I'm in trouble since the table doesn't have that field.

Thanks anyways,

Fidel.

emanuel_klenner
Active Participant
0 Kudos
171

Hi Fidel !

Report RFDOPR10 uses logical database DDF. The fields in the dynamic selections are controled via a selection view.

Goto transaction SE80 -> other objects (or edit objects)

-> position on the MORE tab and then pick radio button selection view. Press Display.

On the next screen: origin of view SAP, logical database DDF and name of view STANDARD.

On the next screen you'll see the layout of the dynamic selections for the report.

To create your own version of this copy the selection view

to origin CUS, logical database DDF name of view STANDARD.

Now you can change the view fields (and include additional tables -> as long as they belong to the logical DB).

Hope that helps.

0 Kudos
171

Alternatively, you can go through transaction SLDB, in the menu, EXTRAS->SELECTION VIEWS.