Skip to content

How to generate conditional input parameters? #246

Answered by fw2568
kambalin asked this question in Q&A
Discussion options

You must be logged in to vote

Ok, understood.

Many functions (and all BAPIs) in SAP handles a empty value like a unset value. So normally you just have to set a value to a empty string if it is unset. But sometimes values depend on each other - then in most cases simple conditions could be applied.
Here a copy of some production code of us to create a notification in SAP with the BAPI BAPI_QUALNOT_CREATE. StartDateTime is set conditional in this sample and for other optional fields fields we just set the default:

  return _rfcContext.CallFunction("BAPI_QUALNOT_CREATE",
          f => f
              .SetField("NOTIF_TYPE", message.NotificationType)

              // header
              .SetStructure("NOTIFHEADER", s =>

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by kambalin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants