on 10-12-2016 10:12 AM
Hi experts,
in ABAP code of my ZReport (cash receipt of FBCJ transaction), I have simple ABAP code looking like this
SELECT SINGLE PERSON1 FROM TCJ_C_JOURNALS INTO usrname
but problem with this code is that it is missing WHERE part, which should look like this
SELECT SINGLE PERSON1 FROM TCJ_C_JOURNALS INTO usrname
WHERE CAJO_NUMBER = *currently selected cash journal on FBCJ Tcode* (item no. 1 on screenshot)
Please see screenshot bellow.
https://s16.postimg.org/zark5oao5/2016_10_12_8_55_38.jpg
If I would need for example in WHERE clause, SAP username, I would easily use SY-UNAME which would read currently login username, BUT how about currently selected cash journal in FBCJ Tcode, is it possible to find such value so I could use it for my ABAP query?
Thank you.
Sam
Look in customizing of 'Financial Accounting Global Settings, Correspondence' for 'Cash document' in 'Define Correspondence Types', and then in either'SAPscript-Based Forms' or 'PDF-Based Forms', also (last and not least) 'Assign Programs for Correspondence Types'.
Regards,
Raymond
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
It seems you're in a form for a sapscript so the CAJONUM should be transfered by it
That mean CAJONUM has to be available in your sapscript
Try to check in the structures or variable used by your sapscript if there's CAJONUM
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raymond,
thank you very much for useful reply.
No, because I can't manage to achieve that using my ABAP code. Please see my screenshot and code bellow. Since ISCJ_POSTINGS is structure and not actual table it doesn't contain any transactional data, I can't pull any data from it so I guess I have to find other way to pull data about *currently selected cash journal*?
Thank you so much for helping me with this issue.
Sam
https://s12.postimg.org/eibdxcm8t/2016_10_13_10_55_09.jpg
*&---------------------------------------------------------------------*
*& Form F_GETPERSON1NAME
*&---------------------------------------------------------------------*
* read the full person's name
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM F_GETPERSON1NAME TABLES int_cond STRUCTURE itcsy
outt_cond STRUCTURE itcsy.
DATA cajonum TYPE ISCJ_POSTINGS.
DATA person1name TYPE string.
person1name = ''.
* read the username:
* TCJ_C_JOURNALS contains PERSON1 and CAJO_NUMBER
* ADRP indice PERSNUMBER contains NAME_LAST NAME_FIRST name_text
SELECT SINGLE CAJO_NUMBER FROM ISCJ_POSTINGS INTO cajonum.
SELECT SINGLE PERSON1 FROM TCJ_C_JOURNALS INTO person1name
WHERE CAJO_NUMBER = cajonum.
READ TABLE outt_cond INDEX 1.
outt_cond-value = person1name.
MODIFY outt_cond INDEX 1.
ENDFORM. " F_GETPERSON1NAME
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raymond,
thank you for useful suggestion.
I agree, it was amateur of me trying read from db. However, I am trying to follow your suggestion regarding "first identify the signature/parameters received in the form driver program" but I am confused because I am having trouble identifying driver program. Can you give me some pointers here please?
Thank you for your effort and trying to help me solve my issue.
Sam
Hi
You should indicate which Sapscript you're using
In SE71 try to go to Form->Check->Texts
The driver program is often shown here
Didn't you get the required information(s) in the signature of the form interface (ISCJ_POSTINGS-CAJO_NUMBER)?
Regards,
Raymond
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.