Showing error during creation of 'dimension set id' in Dimension set entry table.

ManiNavManiNav Member Posts: 120
Hi Everyone,

I am creating 'dimension set id' in temporary dimension set entry table,once its created ,but now its showing its already there.

5if06b1oq3fz.png


Please find below my code:

TempDimSetEntry.RESET;
TempDimSetEntry."Dimension Code" := 'DEPT';
TempDimSetEntry."Dimension Value Code" := DeptCode;
TempDimSetEntry."Dimension Value ID" := DeptID;
TempDimSetEntry.INSERT;


TempDimSetEntry.RESET;
TempDimSetEntry."Dimension Code" := 'CHANNEL';
TempDimSetEntry."Dimension Value Code" := ChanCode;
TempDimSetEntry."Dimension Value ID" := ChanID;
TempDimSetEntry.INSERT;


TempDimSetEntry.RESET;
TempDimSetEntry."Dimension Code" := 'PROJECT';
TempDimSetEntry."Dimension Value Code" := ProjCode;
TempDimSetEntry."Dimension Value ID" := ProjID;
TempDimSetEntry.INSERT;


AvailDimSetId := DimensionManagement.GetDimensionSetID(TempDimSetEntry);
DimensionSetEntry."Dimension Set ID" := AvailDimSetId;
PurchaseHeader."Dimension Set ID" := DimensionSetEntry."Dimension Set ID";
IF DimensionSetEntry."Dimension Set ID" =0 THEN
NewDimSetId := DimensionManagement.CreateDimSetIDFromDimBuf(TempDimBuf);
PurchaseHeader."Dimension Set ID" := DimensionSetEntry."Dimension Set ID";
PurchaseHeader.MODIFY;

how, i should give condition to not create dimension set id for above three combination dimension code(Dept,project and channel),if it is already there.
Please guide me regarding above query.

Thanks,
Mani.

Best Answers

  • ManiNavManiNav Member Posts: 120
    Answer ✓
    Hi Vaprog/Everyone,

    I fixed the above issue.
    I filtered then create,and removed CreateDimSetIDFromDimBuf function as vaprog guide,now its working fine.
    Like:(StagingtoPI: staging table,from where data is taking)
    IF StagingtoPI.Department <> '' THEN BEGIN
    TempDimSetEntry.RESET;
    TempDimSetEntry.INIT;
    TempDimSetEntry.VALIDATE("Dimension Code",'DEPT');
    TempDimSetEntry.VALIDATE("Dimension Value Code",DeptCode);
    TempDimSetEntry.VALIDATE("Dimension Value ID",DeptID);
    IF NOT TempDimSetEntry.INSERT THEN TempDimSetEntry.MODIFY;
    END;

    did for all three dimension code(Dept,project and channel).

    Thanks for the help.
    Mani.

Answers

  • ManiNavManiNav Member Posts: 120
    Hi Vaprog,

    Thanks for your reply.
    Yes,TempDimSetEntry, property: Temporary=Yes.

    As,you advice above: no need for calling CreateDimSetIDFromDimBuf. so, i removed this, but i am getting the same error as above.
    Please guide me further,how i can overcome this issue.

    (And where did you fill TempDimBuf anyway?:-I created temporary=yes,for dimension buffer table,and its updating 'dimension set id' in dimension set entry table inside the createDimSetIdFromDimBuf function.so,atlast i assigned that 'dimension set id' to purchase header.)

    Thanks,
    Mani.
  • ManiNavManiNav Member Posts: 120
    Hi Vaprog/Everyone,

    Please help me regarding above query.

    Thanks,
    Mani.
  • ManiNavManiNav Member Posts: 120
    Answer ✓
    Hi Vaprog/Everyone,

    I fixed the above issue.
    I filtered then create,and removed CreateDimSetIDFromDimBuf function as vaprog guide,now its working fine.
    Like:(StagingtoPI: staging table,from where data is taking)
    IF StagingtoPI.Department <> '' THEN BEGIN
    TempDimSetEntry.RESET;
    TempDimSetEntry.INIT;
    TempDimSetEntry.VALIDATE("Dimension Code",'DEPT');
    TempDimSetEntry.VALIDATE("Dimension Value Code",DeptCode);
    TempDimSetEntry.VALIDATE("Dimension Value ID",DeptID);
    IF NOT TempDimSetEntry.INSERT THEN TempDimSetEntry.MODIFY;
    END;

    did for all three dimension code(Dept,project and channel).

    Thanks for the help.
    Mani.
Sign In or Register to comment.