cancel
Showing results for 
Search instead for 
Did you mean: 

fi exit or workflow ?

Former Member
0 Kudos

Hi friends

i got a requirement -> 'in f-02 the document type should be automatically taken after selecting the GL account no.'.

i have searched user exit for that but hav'nt got uptill . plese suggest me wheather any exit is available for that or i have to go for workflow for that .

thanks

regards

siddharth neekhra

tch cnlt

Accepted Solutions (1)

Accepted Solutions (1)

andreas_mann3
Active Contributor
0 Kudos

Hi Siddarth

i think, it's not possible to change the doc.type with a field exit after filling the account in the 1st posting-line, because posting-head is ready to this time and not changeable in SAP-Standard:

You 've to fill doc. type at first and then the first positng-line !

A possible solution might be to add a small report/dialog to fill account

and deduce doc.type and then work with "call transaction 'F-02' using bdcdata mode 'E' ".

Regards Andreas

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I think you should rather try a FIELD EXIT. Run report RSMODPRF from SE38, select the respective data element and implement your logic.

When you run the report, take a look at its Documentation for further details.

Regards

Message was edited by: Shehryar Khan

Former Member
0 Kudos

Hi everybody,

I don't think a field exit could be useful, because with a field exit you can only access one field. For example, if you monitor field "G/L account", you could only change/validate information on "G/L account", not on "document type".

You could rather use Business Transaction Event 00001120.

For more help on BTE's, you could enter this link:

I hope it helps. BR,

Alvaro

Message was edited by: Alvaro Vidal-Abarca

Former Member
0 Kudos

Hi,

You said: <b>"I don't think a field exit could be useful"</b>, I humbly disagree, there are ways

<b>"because with a field exit you can only access one field"</b>, I totally agree but there are ways ;-).

All you have to do is to implement Field Exits for both GL Account and Document Type. In Field Exit for GL Account, simply EXPORT the value of entered GL Account to ABAP Memory. In the Field Exit for Document Type, import this value from ABAP Memory and implement logic to choose your document type. Set OUTPUT = CHOSEN_DOC_TYP.

Hope it helps.

Regards

Former Member
0 Kudos

thanks u mr. khan

i think its gonna work .

but can u tell me how to export the value of account no. to abap memory .

many thanks

regards

siddharth neekhra

tch cnlt

Former Member
0 Kudos

Hi,

use

export account to memory id 'ZACCOUNT'.

and

import account from memory id 'ZACCOUNT'.

regards

Siggi

Former Member
0 Kudos

Hi all,

oops, you're right 😄

Former Member
0 Kudos

THANKS i have tried this but its still not working .

i am getting error "document type not defined".

code is as follows

*****************************TO GET ACCOUNT NO.

FUNCTION FIELD_EXIT_NEWKO.

*"----


""Local interface:

*" IMPORTING

*" REFERENCE(INPUT)

*" EXPORTING

*" REFERENCE(OUTPUT)

*"----


export INPUT to memory id 'ZACCOUNT' .

OUTPUT = INPUT .

ENDFUNCTION .

*****************************TO GET DOCUMENT TYPE

FUNCTION FIELD_EXIT_BLART.

*"----


""Local interface:

*" IMPORTING

*" REFERENCE(INPUT)

*" EXPORTING

*" REFERENCE(OUTPUT)

*"----


DATA: BLART LIKE BKPF-BLART .

DATA: NEWKO LIKE RF05A-NEWKO .

TABLES: BKPF .

import NEWKO from memory id 'ZACCOUNT'.

SELECT SINGLE BLART FROM BKPF INTO BLART WHERE BELNR = NEWKO .

OUTPUT = BLART .

ENDFUNCTION.

Former Member
0 Kudos

Hi,

Try this in your first Field Exit:

 
DATA: NEWKO LIKE RF05A-NEWKO .
NEWKO = INPUT.
EXPORT NEWKO TO MEMORY ID 'ZACCOUNT'.

The name of variable exported and imported should be the same. Take a look at the documentation for EXPORT and IMPORT for further additions.

What is the value of SY-SUBRC after IMPORT as well as after SELECT statement? You can test the function by pressing F8 and then debugging it.

Regards

Message was edited by: Shehryar Khan

Message was edited by: Shehryar Khan

Former Member
0 Kudos

HI

THANKS

I HAVE TRIED THAT ALSO BUT ITS STILL NOT WORKING YET . AS THE VALUE OF NEWKO IS NOT PASSING TO MEMORY ID . AND SY-SUBRC IS 0 AFTER THAT PROCESS .

PLESE HELP ME @IS THER OTHER WAY TO EXPORT VALUE TO MEMORY ID .

REGARDS

SIDDHARTH NEEKHRA

TCH CNLT

Former Member
0 Kudos

Hi,

Are you having trouble in exporting value (sy-subrc = 4) or while importing it? Any way, you can try EXPORT <field> TO SHARED BUFFER .... or EXPORT TO DATABASE... Look at the documentation for EXPORT statement for correct syntax.

Hope it helps.

Regards