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: 

A couple of questions...

aris_hidalgo
Contributor
0 Kudos

Hello experts,

I need some enlightenment on the following. Currently I am modifying a report and there are codes which I only have an idea about.Anyway, Below are the codes:

1. What does the FM 'AUTHORITY_CHECK' do?

2. GET PARAMETER ID 'KUN' FIELD gc_kunnr.

SELECT SINGLE kunnr comp_flag INTO (gc_kunnr,v_compflag)

FROM zsoemailid

WHERE bname = sy-uname.

**In question 2, how does the get parameter id code relate to the select statement?

3. IF v_compflag IS INITIAL AND v_uname IS INITIAL.

LOOP AT SCREEN.

IF screen-name = 'PR_UPLD' OR

screen-name = 'P_FLNME' OR

screen-name = '%_PR_UPLD_%_APP_%-TEXT' OR

screen-name = '%FA11003_1000'.

screen-output = '0'.

screen-input = '0'.

screen-active = '0'.

screen-required = '0'.

screen-invisible = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

v_kunnr = gc_kunnr.

ELSEIF v_compflag NE space OR v_uname NE space.

LOOP AT SCREEN.

IF screen-name = 'PR_EDIT' OR

screen-name = 'P_CODE' OR

screen-name = '%_PR_EDIT_%_APP_%-TEXT' OR

screen-name = '%FA12010_1000' OR

screen-name = 'PR_ADD' OR

screen-name = '%_PR_ADD_%_APP_%-TEXT'.

screen-output = '0'.

screen-input = '0'.

screen-active = '0'.

screen-required = '0'.

screen-invisible = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

MESSAGE i000 WITH

'You are not authorised to use this transaction'.

LEAVE PROGRAM.

ENDIF.

**how can I debug this code?

4. I used ALV for the report's display. Now, I used the BLOCK_ALV, my boss said that I should use the GRID_ALV instead. Do I need to re-write all the ALV FMs? Thanks a lot guys and have a nice day!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

answers

1). Authority check is used to check for authorizations for a specific org entity like plant or specific sales org or for any specific actions like whether the user has change authorization or only display authorization.

If the sy-subrc eq 0 after the call it means the user has the authorization.

2). Get parameter id is SAP global memory. WHen you need to pass data from one program to another program which is not within the same session then we use SAP global memory. It can hold a varibale value which can be accessed globally.

3). Not clear with your question. How you can debugg is place a breakpoint at the code and try executing the program and come to the selection screen. The logic is triggered for the selection screen modification.

4). Changing Normal ALV to a GRID ALV is not that difficult but i think changing BLOCK ALV to GRID ALV might require some adjustement in the code.

Cheers

VJ

5 REPLIES 5

Former Member
0 Kudos

Hi,

answers

1). Authority check is used to check for authorizations for a specific org entity like plant or specific sales org or for any specific actions like whether the user has change authorization or only display authorization.

If the sy-subrc eq 0 after the call it means the user has the authorization.

2). Get parameter id is SAP global memory. WHen you need to pass data from one program to another program which is not within the same session then we use SAP global memory. It can hold a varibale value which can be accessed globally.

3). Not clear with your question. How you can debugg is place a breakpoint at the code and try executing the program and come to the selection screen. The logic is triggered for the selection screen modification.

4). Changing Normal ALV to a GRID ALV is not that difficult but i think changing BLOCK ALV to GRID ALV might require some adjustement in the code.

Cheers

VJ

0 Kudos

Hi VJ,

in no. 2, Can you give me scenarion in which get parameter is used?

for my no. 3 question, I mean, Whats the meaing of those text like '%_PR_EDIT_%_APP_%-TEXT' or '%_PR_UPLD_%_APP_%-TEXT' ?

Thanks alot!

0 Kudos

Hi,

'%_PR_EDIT_%_APP_%-TEXT' & '%_PR_UPLD_%_APP_%-TEXT' are the screen field names for the text that appears on the screen for the parameters PR_EDIT & PR_UPLD.

Regards,

Suresh Datti

0 Kudos

Hi Viray,

Heres an example of when GET and SET parameters are used.

WHen you access any SAP transactioins like Material master creation MM01/2/3 or Sales order creation Va01/2/3 the system stores the material number or the order number using the SET/GET parameter. Hence when you open another session and goto the transaction above you can see the last used material number or order number. It comes from SET/GET global menmory.

Even when we do a CALL TRANSACTION we pass SET parameter so that the std transaction can trigger the GET parameter and populate the value for the relavant field. On any SAP transaction if you want to know if thre is a SET or GET parameter you can do a F1 help and then F9 for technical details. The screen that pops up will display the SET/GET parameter field. Alternatively you can check the value in a data element. For example check dataelement matnr it has a parameter id MAT.

We can also have custom parameter IDs.

Cheers

VJ

Former Member
0 Kudos

Hi Viray,

><i>GET PARAMETER ID 'KUN' FIELD gc_kunnr</i>

2..You can use SAP memory either to pass data from one program to another within a session..parameters can be

set either for a particular user or for a particular program using the SET PARAMETER statement.

Other ABAP programs can then retrieve the set parameters using the GET PARAMETER

statement.. Nothing to do with the select statement...

3.IN the debug mode..

just press tables button and type in 'SCREEN' in the bottom .. put a break-point in the loop and see the values for each loop..

4. No it requires inly a small modification..

IN grid the number of import and export parameters are more.. you'll have to take care of that..

regards

satesh