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

GET PARAMETER from FBCJ ...

Former Member
0 Likes
1,128

Hi there. I've got such a strange problem ...

...

I've got a Z-program from which I have to CALL 'FBCJ' transaction and then pull out parameters from FBCJ into my z-program ...


  DATA: _CJCAJONR TYPE cjnr .
  DATA: _BUKRS    TYPE bukrs .

  CALL TRANSACTION 'FBCJ' .
  GET PARAMETER ID 'BUK' FIELD _BUKRS . " ok (sy-subrc = 0)
  GET PARAMETER ID 'CJCAJONR' FIELD _CJCAJONR . " sy-surbrc = 4

The problem is that _BUKRS is taken correctly, ... but CJCAJONR not

What could be the reason?

PS.

Both parameters are taken from the same FBCJ screen (Screen: 0050 Cash Journal Entry Screen for New Users), in technical information there is:

-> parameter: BUK, datatype: BUKRS

-> parameter: CJCAJONR, datatype: CJNR

6 REPLIES 6
Read only

Former Member
0 Likes
951

Hi,

If parameter: CJCAJONR has datatype: CJNR

Then why are u writing this:

GET PARAMETER ID 'CJCAJONR' FIELD _CJCAJONR . " sy-surbrc = 4

instead of this

GET PARAMETER ID 'CJCAJONR' FIELD _CJNR .

Regards

Mudit

Read only

Former Member
0 Likes
951

Hi Piotr,

Please first go to the transaction FBCJ .

Then fill the values of cjnr and bukrs .

Then once execute your program.

Regards

Pinaki

Read only

Former Member
0 Likes
951

hi,

i have checked the tcode :FBCJ .i t too had a similar situation . it seems that global parameted id is getting cleard some where in the program in case of

CJCAJONR.

so you will not be able to fetch the values of this pram using get.

.To solve this you can create a pram id inside the tocde FBCJ and then pass that parm into the abab code.

safel

Read only

0 Likes
951

Safel007

I checked FBCJ code and there are few


SET PARAMETER ID 'BUK' FIELD f_comp_code.

but no


SET PARAMETER ID 'CJCAJONR' FIELD ... .

that's probably why we don't have that parameter in our Z-program ...

PS. I'm searching in first line solutions not modifying standard

Mudit Batra

Because I've got no _CJNR variable declared so how could I use it?

Pinaki Mukherjee

no result

Read only

0 Likes
951

Hi ,

If the 'CJCAJONR' does not exist for the current user in the SAP Memory,

the GET PARAMETER ID .... will not be successful.

That is why the SY-SUBRC becomes 4.

So once you pass some value in that parameter id after that the GET PARAMETER ID..

will be successful.

In the bellow code sy-subrc will be not be 4.

It will be 0.

DATA: _CJNR TYPE CJNR .
DATA: _BUKRS    TYPE BUKRS.

CALL TRANSACTION 'FBCJ' .
_BUKRS = '1000'.
SET PARAMETER ID 'BUK' FIELD  _BUKRS .
CLEAR _BUKRS.


_CJNR = '1'.
SET PARAMETER ID 'CJCAJONR' FIELD   _CJNR .
CLEAR  _CJNR.

GET PARAMETER ID 'BUK' FIELD _BUKRS . " ok (sy-subrc = 0)
GET PARAMETER ID 'CJCAJONR' FIELD _CJNR . " sy-surbrc = 0

Read only

0 Likes
951

Hi,

I checked the same scenario and I too getting same type of issue.

Better we need to check for guidance from SAP. or we need to check for any notes