cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass boolean values from webdynpro java to RFC ??

Former Member
0 Kudos

Hi Experts,

I have a requirement where I have to pass boolean values to RFC .The RFC has boolean value format as X. But in webdynpro java I am only able to pass either true or false.

When I pass either true or false , it doesnt get converted to X in RFC as I found out from debugging.

Please advise/suggest.

Regards,

Mamai.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mamai,

If Boolean is not getting converted into X in RFC then you can do it like this.

If(true) //put the boolean variable here

{

// pass X to the RFC

}

Else

{

// pass blank i.e. donu2019t set any value to the RFC

}

Regards

Yugandhar Reddy

Former Member
0 Kudos

HI,

This is the model node- element where I have to set the boolean value and execute the RFC .

Here I have only options to set either true or false.

datax1.setCountry(true);

datax1.setLangu(true);

datax1.setName(true);

Please suggest how do i pass X to the RFC in this case??

Regards,

Mamai.

p330068
Active Contributor
0 Kudos

Dear Mamai,

If you face the issue while passing X boolean value to the RFC. Then you need to ask ABAP team to change the RFC to alllow the boolean value like TRUE or FALSE. Ask to chande the data type for the field.

Best Regards

Arun Jaiswal

Former Member
0 Kudos

Thanks Arun for the input.

But as I checked with the ABAP guy , he showed me the data is being pulled from BAPIAD1VLX

where all the fields are as type CHAR.

But I can see alll the attributes of the model node to be type boolean where I can pass only true or false !! and not X !!

I really cant make out why is this happening !!

Please help / advise.

Regards,

Mamai.

former_member40425
Contributor
0 Kudos

Hi,

Attribute with data type as CHAR1 will be having DOMAIN with Yes/No.If BAPI is not standard one, You need to request ABAP Person to remove Yes/No in domain. After getting thiis done, re-import your model, now your attribute will be created of type string which you can set '`X` or blank for true or false respectively.

I hope it helps.

Regards,

Rohit

Answers (4)

Answers (4)

Former Member
0 Kudos

WDJ does the required conversions. ABAP data types are different and Java data types are different.

So the conversion happens. Java boolean when it gets converted to ABAP, boolean in ABAP is CHAR data type of length 1 with value X or blank. X represent true and no value is false.

Even this is true in WDA.

Former Member
0 Kudos

passing boolean true is passing X to the RFC.

If you put a http break point, areu not seeing X value in the back end function module?

Former Member
0 Kudos

Hello

Could require a specific char, would normally rely on someone telling you acceptable values. I find in many cases it is Y:N | 0:1


generalT.setValue("CONCENSUS", (ManageHelper.isTrue(createProjectRequest.getGeneralType().isConcensus()) ? "Y" : "N" ));
generalT.setValue("HARMONIZED_LEVEL", (ManageHelper.isTrue(createProjectRequest.getGeneralType().isHarmonized())? "1" : "0" ));

junwu
Active Contributor
0 Kudos

try to pass X to rfc