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

GL account changes

Former Member
0 Likes
1,369

Hi Experts

In FS10N transaction , I want to copy as ZFS10N and make the GL Account field as disable so that no user can changed the GL account, I want to give only 80000 GL account for the user. I try using the following but did not success .

Program ZRFGLBALANCE

select-options: SO_SAKNR for RF42B-SAKNR modif ID sak

visible length 10 no-extension no intervals default '86500' OBLIGATORY ,

.....

....

...check selections...................................................

at selection-screen.

"AT SELECTION-SCREEN OUTPUT.

"IF SO_SAKNR-low IS NOT INITIAL .

LOOP AT SCREEN.

IF screen-name = 'SO_SAKNR-LOW' . "OR screen-name = 'ERDAT-HIGH'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

any comments to get it done pls

Regards

Chris

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,192

Hi,

You need to code like this;

IF screen-group1 = 'SAK'
screen-input = 0.
MODIFY SCREEN.
ENDIF.

This will solve your problem.

The other way around to do it in the standard program itself is by using Transaction Variant (Tcode - SHD0), no need to take Zcopy of the program.

Regards

Karthik D

7 REPLIES 7
Read only

Former Member
0 Likes
1,193

Hi,

You need to code like this;

IF screen-group1 = 'SAK'
screen-input = 0.
MODIFY SCREEN.
ENDIF.

This will solve your problem.

The other way around to do it in the standard program itself is by using Transaction Variant (Tcode - SHD0), no need to take Zcopy of the program.

Regards

Karthik D

Read only

Former Member
0 Likes
1,192

Hi Karthik D

Thanks for your reply , but it is not disabling the GL account still when I run the user can change it , I try using loop at screen also but still

the same.

...check selections...................................................

at selection-screen.

loop at screen

IF screen-group1 = 'SAK'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

endloop.

Chris

Read only

0 Likes
1,192

Hi,

The below code works for me, do like this;

Report zdk_test.
TABLES : RF42B.

select-options: SO_SAKNR for RF42B-SAKNR modif ID SAK
visible length 10 no-extension no intervals default '86500' OBLIGATORY.

AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-group1 = 'SAK'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.

I think you would have given the modif ID in small letter, better give it in Capital letters.

Hope this will solve your problem.

Regards

Karthik D

Edited by: Karthik D on Jun 22, 2009 10:08 AM

Read only

Former Member
0 Likes
1,192

Hi Karthik D

Thanks for your prompt reply, I try your coding before it works perfectly but there is som hassell in it

1. First of all I used your coding then it is disabling the field OK FINE but not executing properly it is comming with an error as Only Select company codes with the same fiscal year. where as if i removed the coding it is executing ..

2. If I remove output and place only at selection-screen it is executing but unable to make it disable.

AT SELECTION-SCREEN OUTPUT.

3. Is there any way I can do coding which the user can select only 86500 , If they put any other number then the error message should display

Regards

Chris

Read only

0 Likes
1,192

Hi,

Can you post the selection screen code ?

Regards

Karthik D

Read only

Former Member
0 Likes
1,192

Hi Karthik D

You can open the program from fs10n (RFGLBALANCE). I did the copy of this program and rename it ias AFGLBALANCE see the below coding ....I did changes in at selection screen and added the coding to disable SAK .

report ZRFGLBALANCE message-id FDBL.

...tables.............................................................

tables: SKC1A,

SKC1C,

RF42B,

SSCRFIELDS.

...selections.........................................................

*select-options: SO_SAKNR for RF42B-SAKNR memory id SAK

  • matchcode object SAKO

  • visible length 10,

select-options: SO_SAKNR for RF42B-SAKNR modif ID sak

visible length 10 no-extension no intervals default '86500' OBLIGATORY ,

SO_BUKRS for SKC1C-BUKRS memory id BUK.

parameters: GP_GJAHR like SKC1C-GJAHR memory id GJR.

select-options: SO_GSBER for RF42B-GSBER memory id GSB.

parameters: GP_CURTP like RFPDO2-ALLGCRTP.

selection-screen function key 1.

...selection screen for processing of worklists.......................

selection-screen begin of screen 2000.

selection-screen begin of block ACCOUNT with frame title TEXT-010.

parameters: GP_WLSAK like RF42B-IDNTS.

select-options: SO_WLSAK for SKC1A-SAKNR memory id SAK.

selection-screen end of block ACCOUNT.

selection-screen begin of block COMPANY with frame title TEXT-011.

parameters: GP_WLBUK like RF42B-IDNTB.

select-options: SO_WLBUK for SKC1A-BUKRS memory id BUK.

selection-screen end of block COMPANY.

parameters: GP_GJHR2 type GJAHR memory id GJR.

select-options: SO_GSBR2 for SKC1C-GSBER.

parameters: GP_CRTP2 like RFPDO2-ALLGCRTP.

selection-screen function key 2.

selection-screen end of screen 2000.

...internal data......................................................

constants: GC_LDB type TRDIR-LDBNAME value 'SDF',

GC_KOART type KOART value 'S'.

data: LS_PARAMS like RSPARAMS.

data: begin of LS_SAKNR,

SIGN(1) type C,

OPTION(2) type C,

LOW type SAKNR,

HIGH type SAKNR,

end of LS_SAKNR.

...internal data common for all account types.........................

INCLUDE ZRFBALANCEDATA.

*include RFBALANCEDATA.

...initialization.....................................................

initialization.

...initialize data table..............................................

refresh LT_BALANCE_DATA.

...remove user command for batch and print jobs.......................

perform CHANGE_STATUS.

...set text for additional function keys..............................

SSCRFIELDS-FUNCTXT_01 = TEXT-005.

SSCRFIELDS-FUNCTXT_02 = TEXT-006.

...check selections...................................................

*at selection-screen .

AT SELECTION-SCREEN .

loop at screen

IF screen-group1 = 'SAK' .

screen-input = 0.

MODIFY SCREEN.

ENDIF.

endloop.

...process user command...............................................

case SSCRFIELDS-UCOMM.

when 'ONLI'.

...get local range for g/l account....................................

if not GP_WLSAK is initial.

perform GET_RANGE_FROM_WORKLIST tables GT_RANGE

using GP_WLSAK

'SAKNR'.

refresh SO_WLSAK.

loop at GT_RANGE.

move-corresponding GT_RANGE to SO_WLSAK.

append SO_WLSAK.

endloop.

endif.

refresh LR_SAKNR.

append lines of SO_WLSAK to LR_SAKNR.

loop at SO_SAKNR.

LS_SAKNR-SIGN = SO_SAKNR-SIGN.

LS_SAKNR-OPTION = SO_SAKNR-OPTION.

if SO_SAKNR-LOW cn '0123456789'.

LS_SAKNR-LOW = SO_SAKNR-LOW.

else.

LS_SAKNR-LOW = SO_SAKNR-LOW+6.

endif.

if SO_SAKNR-HIGH cn '0123456789'.

LS_SAKNR-HIGH = SO_SAKNR-HIGH.

else.

LS_SAKNR-HIGH = SO_SAKNR-HIGH+6.

endif.

append LS_SAKNR to LR_SAKNR.

endloop.

...check, if at least one account has been specified..................

if LR_SAKNR[] is initial.

clear SSCRFIELDS-UCOMM.

refresh LR_SAKNR.

message E002.

endif.

...get local range for company code...................................

if not GP_WLBUK is initial.

perform GET_RANGE_FROM_WORKLIST tables GT_RANGE

using GP_WLBUK

'BUKRS'.

refresh SO_WLBUK.

loop at GT_RANGE.

move-corresponding GT_RANGE to SO_WLBUK.

append SO_WLBUK.

endloop.

endif.

refresh LR_BUKRS.

append lines of SO_WLBUK to LR_BUKRS.

append lines of SO_BUKRS to LR_BUKRS.

if LR_BUKRS[] is initial.

refresh LR_SAKNR.

refresh LR_BUKRS.

clear SSCRFIELDS-UCOMM.

message E007.

endif.

...get local range for fiscal year....................................

LS_GJAHR-SIGN = 'I'.

LS_GJAHR-OPTION = 'EQ'.

if GP_GJAHR is initial.

LS_GJAHR-LOW = GP_GJHR2.

else.

LS_GJAHR-LOW = GP_GJAHR.

endif.

clear LS_GJAHR-HIGH.

if not LS_GJAHR-LOW is initial.

append LS_GJAHR to LR_GJAHR.

else.

clear SSCRFIELDS-UCOMM.

refresh LR_SAKNR.

refresh LR_BUKRS.

message E008.

endif.

...local ranges for business areas...................................

append lines of SO_GSBER to LR_GSBER.

append lines of SO_GSBR2 to LR_GSBER.

...check existence of given g/l accounts.............................

loop at LR_SAKNR transporting no fields

where OPTION ne 'EQ' or

SIGN ne 'I'.

exit.

endloop.

if SY-SUBRC = 0.

select SAKNR from SKB1 into table LT_SAKNR

where SAKNR in LR_SAKNR

and BUKRS in LR_BUKRS.

else. " worklist

select SAKNR from SKB1 into table LT_SAKNR

for all entries in LR_SAKNR

where SAKNR eq LR_SAKNR-LOW

and BUKRS in LR_BUKRS.

endif.

*Commented by Piroz Eslam (Wagner IT Department )

if SY-SUBRC eq 86500.

  • if SY-SUBRC ne 0.

clear SSCRFIELDS-UCOMM.

refresh LR_BUKRS.

refresh LR_SAKNR.

refresh LR_GSBER.

refresh LR_GJAHR.

message E030(MSITEM).

endif.

clear LT_SAKNR.

refresh LT_SAKNR.

...check authorizations.............................................

perform CHECK_AUTHORITY_GROUPS

using LR_BUKRS

LR_SAKNR

LR_KUNNR

LR_LIFNR

GC_KOART.

...switch on worklists..............................................

when 'FC01'.

leave to transaction 'FS10NA'.

...switch off worklists.............................................

when 'FC02'.

leave to transaction 'FS10N'.

endcase.

...start-of-selection.................................................

start-of-selection.

...get valid currency type............................................

if GP_CRTP2 is initial.

LD_CURTP = GP_CURTP.

else.

LD_CURTP = GP_CRTP2.

endif.

if LD_CURTP is initial or LD_CURTP eq '00'.

LD_CURTP = '10'.

endif.

...check, if all company codes given use the same fiscal year.........

perform CHECK_FISCAL_YEARS using LR_BUKRS

LD_RC.

if LD_RC ne 0.

message I021.

return.

endif.

...check, if display currency is the same for all company codes.....

...selected.........................................................

perform CHECK_CURTP tables LR_BUKRS

using LD_CURTP

LD_RC.

if LD_RC ne 0.

message I022.

return.

endif.

...build table with selection criteria..............................

perform BUILD_COSEL tables LT_COSEL

using LR_BUKRS

LR_KUNNR

LR_LIFNR

LR_SAKNR

LR_GJAHR

LR_GSBER

SPACE

SPACE

SPACE

GP_WLSAK

GP_WLBUK

LD_CURTP.

...build table with selections for LDB................................

perform BUILD_RSPARAMS tables LT_COSEL

LT_PARAMS

using GC_LDB.

LS_PARAMS-SELNAME = 'SD_CURTP'.

LS_PARAMS-SIGN = 'I'.

LS_PARAMS-OPTION = 'EQ'.

LS_PARAMS-LOW = LD_CURTP.

clear LS_PARAMS-HIGH.

append LS_PARAMS to LT_PARAMS.

...build table with callbacks.........................................

perform BUILD_CALLBACK tables LT_CALLBACKS.

...get transaction data...............................................

call function 'LDB_PROCESS'

exporting

LDBNAME = GC_LDB

tables

CALLBACK = LT_CALLBACKS

SELECTIONS = LT_PARAMS

exceptions

LDB_SELECTIONS_NOT_ACCEPTED = 4

others = 1.

if SY-SUBRC eq 4.

message id SY-MSGID type SY-MSGTY number SY-MSGNO

with SY-MSGV1 SY-MSGV2.

endif.

end-of-selection.

...check, if data has been fount at all.............................

if LT_BALANCE_DATA is initial.

message I020 with GP_GJAHR.

return.

endif.

...display data.....................................................

call function 'FDBL_BALANCES_DISPLAY'

exporting

PT_COSEL = LT_COSEL

changing

PT_BALANCE_DATA = LT_BALANCE_DATA.

INCLUDE ZRFBALANCE.

  • include RFBALANCE.

Chris

Read only

0 Likes
1,192

Hi,

For that field only change Modif Id to something else ( say GLA) and change the if condition also.

Check and revert back.

Regards

Karthik D

P.S.: Post code inside Code Tag