on 07-21-2009 2:45 PM
Dear Experts ,
I have a case where i have created infoset & query with T Code SQ01.
It is very similar to the MB51 Report where the value of the field MSEG-DMBTR is output .
But i want the vallue of the field MSEG-DMBTR to be negative in case the value of the field MSEG-SHKZG is 'S'.
eg. if mseg -dmbtr is 1244.00 & mseg-shkzg is "s" then in o/p mseg-dmbtr shud appear as -1244.00.
For this I want to write a code in the code tab of the infoset .
Can anyone pls suggest if this is possible thru what i am doing ??
Regards
Anis
Hi,
Since your coding in an infoset, declare a field say v_dmbtr & display this field instead of MSEG-DMBTR.
Now write the below few lines for this field.
CLEAR: v_dmbtr.
IF mseg-shkzg = 'S'.
v_dmbtr = - mseg-dmbtr.
ENDIF.
Regards,
Vivek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Vivek ,
We have used the following code in order to meet the req :
data:v_dmbtr like mseg-dmbtr,v_shkzg like mseg-shkzg.
CLEAR: v_dmbtr, v_shkzg.
IF v_shkzg = 'S'.
v_dmbtr = - v_dmbtr.
ENDIF.
but the system gives run time error after executing the inputs.
The erreor says :
The following syntax error occurred in program "/1BCDWB/SAPLIQG000000000050
in include "/1BCDWB/IQG000000000050DAT " in
line 26:
"Statement is not accessible"
Can you please help?
Regards
Anis
Hi,
From u r code it is seen that u have declared the v_dmbtr ( data:v_dmbtr like mseg-dmbtr) . U don't have to declare this here as u have to declare in Extras tab. and in code u have to asign the value of mesg-dmbtr as negative if it is credit.
clear v_dmbtr.
IF mseg-shkzg = 'S'.
v_dmbtr = mseg-dmbtr * -1.
ENDIF.
Hi,
Have you defined v_dmbtr as a Field in your Infoset ?
The log says the field is not accessible, can you let me know how you have defined & where have you entered the code? Is it the processing section or in a seperate place.
Alternatively if you can upload the screen shot to picasaweb or some place would help for a better understanding.
Regards,
Vivek
Hello Vivek ,
I have put the code in the code tab of the infoset.
The code section is : DATA
The code that you & amit have suggested is :
clear v_dmbtr.
IF mseg-shkzg = 'S'.
v_dmbtr = mseg-dmbtr * -1.
ENDIF.
BUT
the system gives an errror saying ...
Error in Code at AT SELECTION-SCREEN OUTPUT
Field "V_DMBTR" is unknown. It is neither in one of the specified tables
nor defined by a "DATA" statement. .
TO correct this error i modified the code to :::
data:v_dmbtr like mseg-dmbtr,v_shkzg like mseg-shkzg.
CLEAR: v_dmbtr, v_shkzg.
IF v_shkzg = 'S'.
v_dmbtr = - v_dmbtr.
ENDIF.
The system now doest give erreor while generating teh infoset , but as the prog is run , teh system gives a run time error , saying
The following syntax error occurred in program "/1BCDWB/SAPLIQG000000000050
in include "/1BCDWB/IQG000000000050DAT " in
line 26:
"Statement is not accessible"
Pls tell us hw 2 go abt it ??
Thx
Anis
Hi,
Follow as per below:
1. In SQ02, Click on Code (or Shift + F8)
2. In Extras Tab click on new & in the pop-up box, specify name as v_dmbtr & select Additional Field radio box
3. Give a description in Long Text & in Header & in the LIKE reference field specify MSEG-DMBTR
4. Give the sequence of Code as 1.
5. Now position the cursor on this field & click on Coding For Addition
6. In this section paste the code which i specified in the earlier post.
7. Now Click on Field Groups (or F6), click on New & add a Group Called Additional Fields.
8. Now select your field v_dmbtr from the Data fields section which you see on the left hand section, right click & say add to Field Group & then add it to the new field group which you created.
9. Save your infoset & generate the same.
10. Open your query in SQ01 & add this field to your display.
Do the above & revert if you face any issues.
Regards,
Vivek
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.