Skip to Content

How to block blank value of a field in message mapping in SAP pi 7.3 (Soap to RFC)

Please suggest how I can block a blank value coming in a field in message mappng in pi (soap to rfc scenario)

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

10 Answers

  • Best Answer
    Jun 25, 2015 at 06:58 AM

    Hi All,

    I have achieved my target by doing this mapping in which the target Item node will not be created if Sign field is empty.

    and with this no space or blank value will go to Bapi structure.

    Mappin screen shot

    Thanks,

    Rishabh


    Add comment
    10|10000 characters needed characters exceeded

  • May 27, 2015 at 03:28 PM

    What do you mean by block? you want the message to fail in the mapping?

    If so just check if the length of the field is > 0 and use create if to map it to any mandatory field(1..1) on the target side.

    Throwing Smart Exceptions in XI Graphical Mapping

    Add comment
    10|10000 characters needed characters exceeded

  • May 27, 2015 at 05:25 PM

    Hey Hareesh,

    Suppose there are 4 fields to send an input to a RFC via SOAP UI -- i.e Material, Vendor, Storage Location, Posting date. etc (no field is mandatory)

    I can send input in 1 field also or 4 fields also.

    so if I am sending data in material field only. then bapi is assuming some value for vendor, storage Location, plant, Posting date etc. and throwing an error that

    this plant doesnot exist

    this vendor doesnot exist

    this storage location doesnot exist

    etc


    so I want to do a mapping in which if a field is filled with input value in source structure then only it should populate the value in target structure or it should not pass blank value to target structure if no input data is passed in it.


    Please suggest what node function or UDF i have to do use in this.


    Regards,

    rishabh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 28, 2015 at 06:14 AM

    Hi Rishabh,


    Using EQUALS text function check whether the input is having blank value or not, pass this output to a NOT Boolean function and then the output of this to a IFwithoutElse boolean function, the other input of the IF is the input field only. Pass this to the target field.

    Regards

    Vishnu

    Add comment
    10|10000 characters needed characters exceeded

  • May 28, 2015 at 10:47 AM

    Hi Vishnu,

    The screen shot i have pasted is not working. The requirement is simple

    If a field is blank I donot want to pass is to target structure.

    Can u please explain me its mappin in detail

    Rgds,

    rishabh

    Add comment
    10|10000 characters needed characters exceeded

  • May 28, 2015 at 11:29 AM

    It is getting mapping error


    Mapping Req.PNG (41.8 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • May 28, 2015 at 11:31 AM

    Actually I have removed all the mapping now but basically I want that if LOw is empty or blank it should pass to the target Low field.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Rishabh,

      If your requirement is if LOw is empty or blank it should pass to the target Low field, then just remove Not Boolean function from the below mapping:


      Replace field1 with Low field

      Replace header field with Low field

      Regards

      Vishnu

      checkBlank.jpg (9.8 kB)
  • avatar image
    Former Member
    May 28, 2015 at 11:32 AM

    Hello,

    Please check this note -

    1832047 - NULL value handling in PI mapping

    Thanks,

    Atul

    Add comment
    10|10000 characters needed characters exceeded

  • May 28, 2015 at 01:55 PM

    Hi Vishu

    In this way it is giving me message mapping error

    Please suggest any other mapping way.

    Also tell me if Material field has 4 sub fields

    Sign = I

    Option = EQ

    Low = 2334456677

    High = 4454637382

    then do I have to do mapping only in main Material fields or its sub fields also like sign, option, Low , high.

    regards,

    rishabh


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Rishabh,

      Since the four sub fields are present under Items node, just put your logic for the Item node itself, and for its sub fields just do one to one mapping with the corresponding source fields.

      For Item node(if the logic is for Low field not equal to blank, then only populate, then):

      Replace MaterialTy with comparision field(eg: Low)

      Replace target MaterialN with target Items node

      Regards

      Vishnu

      Image.PNG (8.7 kB)
  • May 29, 2015 at 05:59 AM

    Hi Vishu,

    I did as u suggest But is is showing error here.

    Plz look at the screen shot below.


    Plant error.PNG (42.5 kB)
    Soap ui.PNG (50.8 kB)
    Add comment
    10|10000 characters needed characters exceeded