Skip to Content
avatar image
Former Member

JavaScript workflow SAP b1 9.2

Hi all,

Can someone help me please...

I need to implement a workflow for BP or item creation, when a user create it, the script must turn it automatically into inactive, and the workflow have to continue until a certain superuser turn the master data into active manually.

I found an example which is doing it, below is the used script :

var BPCode= CurrentProcess.B1Obj('dataObject1');

var bpService = company.getBusinessService("2");

var bp = company.getBusinessObject("2", BPCode.getCardCode());

var frozenType=Utility.getEnumValue(bp, "FrozenType", "tYES");

var validType=Utility.getEnumValue(bp, "ValidType", "tNO");

bp.setFrozen(frozenType);

bp.setValid(validType);

bpService.update(bp);

When executing this task (SAP HANA 9.2 PL7), the workflow stops and shows me an error : "Client received SOAP Fault from server: [OCRD.RelCode] , 'Field cannot be updated (ODBC -1029)' Please see the server log to find more detail regarding exact cause of the failure."

But the weird thing, when I try to execute it in another company (SAP SQL 9.1 PL8), the task is executed without any error!

Could someone help me to make it work on Hana?

Thanks in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • 10 hours ago

    Hi,

    Its seems Like the Business partner Relation Ship Code is missing or Invalid.

    Please give which version you are using .. any way these are the valid value.in OCRD relcode. Default null

    01=Matriz no exterior, 02=Filial, inclusive agência ou dependência, no exterior, 03=Coligada, inclusive equiparada, 04=Controladora, 05=Controlada (exceto subsidiária integral), 06=Subsidiária integral, 07=Controlada em conjunto, 08=Entidade de Propósito Específico (conforme definição da CVM), 09=Participante do conglomerado, conforme norm
    Add comment
    10|10000 characters needed characters exceeded