2025 Jun 30 11:46 AM - edited 2025 Jun 30 11:48 AM
Hi, I added a script in my iFlow to add custom headers in MPL - I'm using the standard script however the custom header still shows in the message log even though the property has no value or equals to null.
The "po_property" stores a value from a local variable (which I deleted in this scenario) so basically it's considered as null? (correct me if I'm wrong)
Here's my script:
import com.sap.gateway.ip.core.customdev.util.Message;
def Message processData(Message message) {
def messageLog = messageLogFactory.getMessageLog(message);
if(messageLog != null){
def po_number = message.getHeaders().get("po_number");
if(po_number!=null){
messageLog.addCustomHeaderProperty("Local Variable Test", po_number);
}
}
return message;
}Has anyone encountered this or did I miss something?
Request clarification before answering.
Hi,
Can you change to condition as below instead of if (po_number!=null)?
if (po_number)
Also, have you saved the local variable content in the property? In the below script shared by you, you are trying to retrive the value from header instead of property.
Regards,
Priyanka
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 18 | |
| 7 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.