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

Report Parameters with logical database

Former Member
0 Likes
2,029

Hello

I have to read some HR infotypes that are provided with the logical database PNPCE.

Fort his i have written a report that will use my logical database and get some information.

What i need,are some new input parameters on the screen that are added by my report:

parameters: p_persnr type person-pernr,

p_name type p0002-nachn,

p_sname type p0002-vorna.

The problem is that i do not know how to link these parameters to my logical database reading.

When i try to call "get <node>" ,my report is not returning anything.

Is there a way to send my parameters as selection parameters to the logical database?

thank you

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,752

Hi,

You cannot link your parameters to logical database to read.

Instead create a new report category with the fields you want , or write the logic in program for filtering the PNPCE data

based on your input fields.

Regards,

Srini.

12 REPLIES 12
Read only

Former Member
0 Likes
1,753

Hi,

You cannot link your parameters to logical database to read.

Instead create a new report category with the fields you want , or write the logic in program for filtering the PNPCE data

based on your input fields.

Regards,

Srini.

Read only

0 Likes
1,752

Hello

Can you please explain me how to do that?

What exactly do you mean by report category,i have to use this logical database and cannot use selects.

thank you

Read only

0 Likes
1,752

Step 1: Include logical database PNPCE in attributes of program

Step 2: use following code in program:

Tables: PERNR.

Nodes: PERAS.

Infotypes: 0002.

SELECT-OPTIONS: S_NACHN type P0002-NACHN.

S_VORNA type P0002-VORNA.

GET PERAS.

  • Following code will check if employee name falls in name given on selection-screen.

Loop at P0002 where NACHN in S_NACHN

and VORNA in S_VORNA.

Exit.

Endloop.

If Sy-subrc NE 0.

REJECT.

Endif.

..

.

.

<your other code here>

Read only

0 Likes
1,752

I needed to change the input for the Personalnumber so that the user can provide a single entry.

I have managed to do this by deleting the pushbutton for multiple selections fromthe selection screen 1000 with transaction SE51

Now i have to deactivate the LDB additional buttons that appear in the toolbar next to the run button,does anybody have a clue on how to do that?

thank you

Read only

0 Likes
1,752

The usual way of doing this is to hide the push button programmatically using Loop at screen. Modifying the screen in SE51 for a report selection screen is not the right way.

Regards

Ranganath

Read only

0 Likes
1,752

The selection screen 1000 is created dynamically during runtime. I doubt change done by SE51 will solve the issue. In fact there is some code which can help on this.

INITIALIZATION.

  • To restrict the range of PERNRs

PERFORM z_seloption_restrict USING 'PNPPERNR'.

*&---------------------------------------------------------------------*
*&      Form  Z_Seloption_Restrict
*&---------------------------------------------------------------------*
* Restrict range in select option
*----------------------------------------------------------------------*
*      -->VALUE(SOP_NAME)  Name of select option as string
*----------------------------------------------------------------------*
FORM z_seloption_restrict USING value(pv_sop_name).
  IF st_restrict-opt_list_tab[] IS INITIAL.
    CLEAR st_opt_list.
    MOVE: 'EQ' TO st_opt_list-name,
          'X'  TO st_opt_list-options-eq.
    APPEND st_opt_list TO st_restrict-opt_list_tab.
  ENDIF.
  REFRESH : st_restrict-ass_tab.
*  READ TABLE st_restrict-ass_tab INTO st_asst
*                        WITH KEY name = pv_sop_name.
*  IF sy-subrc NE 0.
  CLEAR st_asst.
  MOVE: 'S'         TO st_asst-kind,
        pv_sop_name TO st_asst-name,
        'I'         TO st_asst-sg_main,
        ' '         TO st_asst-sg_addy,
        'EQ'        TO st_asst-op_main.
  APPEND st_asst TO st_restrict-ass_tab.
*  ENDIF.
  CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
    EXPORTING
      restriction = st_restrict.
ENDFORM.                    "Z_Seloption_Restrict

Read only

0 Likes
1,752

This should be enough to have this done


AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF screen-name = '%_PNPPERNR_%_APP_%-VALU_PUSH'.
      screen-active = 0.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

Regards

Marcin

Read only

0 Likes
1,752

Excelent,thank you vey much for your answers,it worked with :AT SELECTION-SCREEN OUTPUT. and then with that loop.

Now i need to disable and hide all the buttons that are generated automatically in the toolbar by the LDB.Does anybody know how to do that?

Thank you

Read only

0 Likes
1,752

Buttons will not appear if HR Report Category is used in program attributes. We can create a new report category with removing following check boxes:

- Matchcode allowed

- Sort allowed

- Org str. allowed.

Read only

0 Likes
1,752

Now i need to disable and hide all the buttons that are generated automatically in the toolbar by the LDB.Does anybody know how to do that?

If you mean disabling all buttons on the toolbar, then you can create custom GUI status with BACK button and ONLI fcode button (RUN option) then use


AT SELECTION-SCREEN OUTPUT.
 DATA it_exc TYPE TABLE OF syucomm.

CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
   EXPORTING
       p_status = 'MY_STATUS'
    TABLES
       p_exclude = it_exc.  "leave this table empty

AT SELECTION-SCREEN.
"now react only on BACK button
"RUN option will work as standard if you use ONLI fcode for it
   IF sy-ucomm = 'BACK'.
     LEAVE PROGRAM.
    ENDIF.

START-OF-SELECTION.  
  WRITE 'Program was run'.

Maybe there is some more sophisticated way of doing this, but as long as this is working it should satisfy your needs.

Regards

Marcin

Read only

0 Likes
1,752

Hello

I have taken them out from that Hr Reporklass but still i have some 3 buttons that still appear in the toolbar and the customer wants them out.(Sort,Input field selection and some dynamic selection button) How can i take thos out?

thank you

Read only

0 Likes
1,752

Perfect,thank you very much for all the answers.

Marcin,i have added a new GUI status and called it with that FM and now it works just like i wanted it,thanks a lot.