‎2015 Jun 04 4:09 AM
Hi Folks,
This is in regards to populate space into a variable as in BI reporting, we get # or NA (not assigned) values in the BI report if we don't have any values in the variable. I need to populate space into one of the variable when there is not value. Please find the below code and its not working, can anyone please fine tune it. More details of my problem are given in this link.
This code is not working. I need to populate space in 2 variable's. 1 variable is 2 length -Numeric format and other is 6 length - char format. Can anyone please help. Appreciate it.
If sy-subrc <> 0.
RESULT = space.
Else.
RESULT = wa_itab-flag.
Endif.
Thank You
DR
‎2015 Jun 04 4:46 AM
Hi Dr,
You can concatenate variable1 with length and separate it by space.
like this :-
concatenate Var1 len into RESULT SEPARATED BY space.
I hope this will resolve your problem.
Thanks,
Aarti
‎2015 Jun 04 4:46 AM
Hi Dr,
You can concatenate variable1 with length and separate it by space.
like this :-
concatenate Var1 len into RESULT SEPARATED BY space.
I hope this will resolve your problem.
Thanks,
Aarti
‎2015 Jun 04 5:02 AM
Thanks for the reply Aarti,
You mean like this... what will var1 to be declared ? why will this statement "RESULT = space "not work ?
If sy-subrc <> 0.
concatenate Var1 len into RESULT SEPARATED BY space.
Else.
RESULT = wa_itab-flag.
Endif.
‎2015 Jun 04 5:41 AM
Hi,
Define a constant like below and assign it to your code.
TYPES:
ABAP_BOOL TYPE C LENGTH 1.
CONSTANT : ABAP_FALSE TYPE ABAP_BOOL VALUE ' '.
If sy-subrc <> 0.
RESULT = abap_false.
Else.
RESULT = wa_itab-flag.
Endif.
Hope this helps.
‎2015 Jun 04 5:57 AM
I guess you need space in between 2 variable1 and lenght right ?
RESULT = space is working for me.
but don't know the reason.
Pls let me know how can I help you ?
Thanks,
Aarti
‎2015 Jun 04 7:01 AM
Thanks You so much Gaurav. You are a star. I have fixed it and the report is showing blank values without NA.
Thanks every body for their answers. But the winner is Gaurav with complete steps.
Cheers
DR
‎2015 Jun 04 4:59 AM
Hi DR,
can you try to define a constant with value space & assign that constant here in above code?
Br,
Amit
‎2015 Jun 04 5:22 AM
Hi Amit,
I am a SAP BI Consultant and not an ABAP'er. How to do that ?
Can you please provide the code, if we assign constant into the result when sy-subrc <> 0 then we are in a problem. It should be either a space when sy-subrc <> 0 and if its 0 it will have the result (flag) populated. We cannot populate any other value other than space in it ? Did I provide you clear info ?
Please update if you need more info.
Thank You
DR
‎2015 Jun 04 5:53 AM
Try this.
CONSTANTS: lv_val TYPE char2 (or string) VALUE ' ' .
If sy-subrc <> 0.
RESULT = lv_val.
Else.
RESULT = wa_itab-flag.
Endif.
Br,
Amit
‎2015 Jun 04 6:03 AM
Hi,
Please change data type of field and use it.
It might get solved.
Regards,
Dular Sharma.