Skip to main content

Hello,

I want to copy purch control plan from template. I get PLSQL trace from IFS screen. It is working correctly. But I create a different procedure for using in different PLSQL block. If I call my new procedure commit is come but record doesn’t create in IFS. 

Anyone help me ? 

Hi my colleague,

 

Use the code snippet below.

 

DECLARE
-- p0 -> g_Bind.n.0]
p0_ FLOAT := 0;

-- p1 -> g_Bind.s.0]
p1_ VARCHAR2(32000) := '';

-- p2 -> g_Bind.s.1]
p2_ VARCHAR2(32000) := 'TCLK';

-- p3 -> g_Bind.s.2]
p3_ VARCHAR2(32000) := '1';

-- p4 -> g_Bind.n.1]
p4_ FLOAT := 1;

-- p5 -> g_Bind.s.3]
p5_ VARCHAR2(32000) := '*';

-- p6 -> g_Bind.dtd0]
p6_ DATE := to_date('2022-01-14-00.00.00','YYYY-MM-DD-HH24.MI.SS','NLS_CALENDAR=GREGORIAN');

-- p7 -> g_Bind.s.4]
p7_ VARCHAR2(32000) := 'TRUE';

-- p8 -> g_Bind.s.5]
p8_ VARCHAR2(32000) := '!
$PART_NO=B000006
$VENDORS=!
-$VENDOR_NO=T000544
-$REVISIONS=!
--$REVISION_NO=1
--
-
';

vendors_ varchar2(32000);
revisions_ varchar2(32000);
attr_ varchar2(32000);

BEGIN
  
attr_ := Message_SYs.Construct('!');

Message_Sys.Add_Attribute(attr_,'PART_NO','B000006');

vendors_ := Message_SYs.Construct('!');

Message_Sys.Add_Attribute(vendors_,'VENDOR_NO','T000544');

revisions_ := Message_SYs.Construct('!');
Message_Sys.Add_Attribute(revisions_,'REVISION_NO',1);

Message_Sys.Add_Attribute(vendors_,'REVISIONS',revisions_);

Message_Sys.Add_Attribute(attr_,'VENDORS',vendors_);


IFSAPP.Qman_Control_Plan_API.Apply_Control_Plan_Template(p0_ ,
p1_ ,
p2_ ,
p3_ ,
p4_ ,
p5_ ,
p6_ ,
p7_ ,
attr_ );

END;


Hi @savasciftci 

Try below as well. Assigning a value for p8_ has moved to BEGIN END block.

PROCEDURE Copy_Purch_Cntrl_Plan (part_no_  VARCHAR2,

                                 vendor_no_ VARCHAR2)

IS

         -- p0 -> g_Bind.n 0]

         p0_ FLOAT := 0;

         -- p1 -> g_Bind.sÂ0]

         p1_ VARCHAR2(32000) := '';

         -- p2 -> g_Bind.s>1]

         p2_ VARCHAR2(32000) := 'TCLK';

         -- p3 -> g_Bind.s<2]

         p3_ VARCHAR2(32000) := '1';

         -- p4 -> g_Bind.n01]

         p4_ FLOAT := 1;

         -- p5 -> g_Bind.sÂ3]

         p5_ VARCHAR2(32000) := '*';

         -- p6 -> g_Bind.dtÂ0]

         p6_ DATE := SYSDATE;

         -- p7 -> g_Bind.s<4]

         p7_ VARCHAR2(32000) := 'TRUE';

         -- p8 -> g_Bind.s<5]

   p8_ VARCHAR2(32000);

   

BEGIN

  

   p8_ VARCHAR2(32000) := '!

$PART_NO='||part_no_||'

$VENDORS=!

-$VENDOR_NO='||vendor_no_||'

-$REVISIONS=!

--$REVISION_NO=1

--

-

';

   FOR REC_ IN (SELECT PPS.* FROM PURCHASE_PART_SUPPLIER pps

               WHERE PPS.PART_NO=PART_NO_

               AND   PPS.VENDOR_NO=VENDOR_NO_

              )LOOP

               --error_sys.Record_GeneraL(lu_name_,'merhaba :P1 1. PARAMETRE :P2 2. PARAMETRE',part_no_,p8_);

  IFSAPP.Qman_Control_Plan_API.Apply_Control_Plan_Template(p0_ , 

                                                          p1_ , 

                                                          p2_ , 

                                                          p3_ , 

                                                          p4_ , 

                                                          p5_ , 

                                                          p6_ , 

                                                          p7_ , 

                                                          p8_);

END LOOP;

END Copy_Purch_Cntrl_Plan;

 


Reply